Avalonia Code OnlyItaliano

From the documentation of RAVAL, the MIT library of the books: the same as in its repository.

This page is available in Italian only for now.

RAVAL 2.0 — i nomi vecchi e quelli nuovi

Dalla 2.0.0 RAVAL è in inglese per tutti, anche per il libro italiano: classi, estensioni, commenti dei sorgenti e messaggi di errore. Non è compatibile con la 1.x: questa tabella serve a portare il codice scritto per la 1.3.9.

Gli esempi del libro italiano restano in italiano: variabili, metodi, classi e testi del programma del lettore (Salva, rubrica, "_Prenota") sono suoi; in inglese è solo quello che viene da RAVAL.

new Button().Content("_Salva").OnClick(Salva).Margin(8)

Le regole dei nomi

  • Un'estensione ha il nome della proprietà che imposta: Margin, Width, Content, Padding, Background... b.Margin è la proprietà di Avalonia, b.Margin(8) è l'estensione di RAVAL. In una chiamata con le parentesi il compilatore scarta la proprietà, che non si può chiamare, e trova l'estensione (misurato con Avalonia 12.1.4).
  • Eccezioni: AutomationName invece di Name (in Avalonia Name è il nome del controllo nell'albero); gli eventi si chiamano On...; i pannelli pronti sono HStack e VStack, perché Row e Column sono le estensioni della Grid.
  • Parametri con nome cambiati: Border(1, radius: 10) (era raggio:), RThemes.Color(chiave, light: ..., dark: ...) (erano chiaro: e scuro:).
  • Il JSON degli errori di RServer è { "error": "..." } (era { "errore": "..." }).

Classi e file

1.x2.0
RAvaRAva
RTemiRThemes
RServerRServer
RRichiestaRRequest
RRispostaRResponse
RErroreHttpRHttpError
RMessaggioErroreRErrorMessage
RAvaTesto.cs · RAvaEventi.cs · RAvaPannelli.csRAvaText.cs · RAvaEvents.cs · RAvaPanels.cs
RAvaColori.cs · RAvaAccesso.cs · RTemi.csRAvaColors.cs · RAvaAccess.cs · RThemes.cs
RRichiesta.csRRequest.cs (contiene anche RResponse, RErrorMessage, RHttpError)
RAva.cs · RAvaMenu.cs · RServer.csstesso nome

RAva — disposizione, contenuti, clic, risorse (RAva.cs)

1.x2.0
Margine(tutti) · Margine(orizz, vert) · Margine(s, a, d, b)Margin(all) · Margin(horiz, vert) · Margin(l, t, r, b)
Allinea(o, v)Align(h, v)
—HAlign(h) (nuova)
AllineaV(v)VAlign(v)
Larghezza(l) · Altezza(a)Width(w) · Height(h)
Colonna(c, span) · Riga(r, span)Column(column, span) · Row(row, span)
Ancora(lato)Dock(side)
Figli(...) · Figlio(c)Children(...) · Child(c)
Testo(s)Text(s)
Contenuto(o)Content(o)
Suggerimento(s)ToolTip(s)
AlClic(metodo)OnClick(method)
Risorsa(prop, chiave)Resource(property, key)
PennelloTema(chiave, ripiego)ThemeBrush(key, fallback)

RAva — testo, cornici, aspetto (RAvaText.cs)

1.x2.0
Corpo(n)FontSize(n)
Peso(p) · Grassetto() · Corsivo()FontWeight(w) · Bold() · Italic()
Carattere(famiglia)FontFamily(name)
Colore(pennello o "#rrggbb")Foreground(brush o "#rrggbb")
ACapo() · AllineaTesto(a)Wrap() · TextAlign(a)
Bordo(spessore, raggio:)Border(thickness, radius:)
Raggio(r)CornerRadius(r)
ColoreBordo(...)BorderBrush(...)
Imbottitura(...) (1, 2 o 4 valori)Padding(...)
Sfondo(...)Background(...)
Visibile(b) · Abilitato(b) · Opacita(o)Visible(b) · Enabled(b) · Opacity(o)
Classe(nomi...)Classes(names...)

RAva — pannelli pronti (RAvaPanels.cs)

1.x2.0
RAva.InRiga(spazio, figli...)RAva.HStack(spacing, children...)
RAva.InColonna(spazio, figli...)RAva.VStack(spacing, children...)
RAva.Griglia(colonne, righe)RAva.Grid(columns, rows)
Spaziatura(s) (StackPanel)Spacing(s)
Spaziature(colonne, righe) (Grid)Spacing(columns, rows)

RAva — eventi, menu, accessibilità, colori

1.x2.0
AlCambioTesto(metodo)OnTextChanged(method)
AlInvio(metodo)OnEnter(method)
AlSpunta(metodo)OnChecked(method)
AlCambioSelezione(metodo)OnSelectionChanged(method)
AlCambioTema(metodo)OnThemeChanged(method)
RAva.Ogni(intervallo, metodo)RAva.Every(interval, method)
AlClic(metodo) su MenuItemOnClick(method)
Tasto("Ctrl+S")HotKey("Ctrl+S")
Nome(s)AutomationName(s)
RAva.Pennello("#1a7fb5") · RAva.Pennello(0xFF1A7FB5)RAva.Brush(...)

RThemes (era RTemi)

1.x2.0
Colore(chiave, chiaro:, scuro:)Color(key, light:, dark:)
QuantiCount
Applica(app) · Applica(elemento)Apply(app) · Apply(element)

RServer

1.x2.0
new RServer(porta)new RServer(port)
Porta · Indirizzi · AvviatoPort · Addresses · Started
TutteLeInterfacce · ThreadInterfacciaAllInterfaces · UiThread
SuTutteLeInterfacce() · SulThreadInterfaccia()OnAllInterfaces() · OnUiThread()
Avvia() · Ferma() · Esegui()Start() · Stop() · Run()
AvviaAsync() · FermaAsync()StartAsync() · StopAsync()
AspettaAvvio(limite)WaitStarted(timeout)
Get · Post · Put · Delete · GetAsync · PostAsync · Jsonstesso nome

RRequest (era RRichiesta), RResponse (era RRisposta), RHttpError (era RErroreHttp)

1.x2.0
Parametro(nome) · Intero(nome) · Intestazione(nome)Param(name) · Int(name) · Header(name)
Corpo<T>() · TestoBody<T>() · Text
Metodo · Percorso · ContestoMethod · Path · Context
RRisposta.Creato(x) · NonTrovato(msg) · Errore(codice, msg)RResponse.Created(x) · NotFound(msg) · Error(status, msg)
RRisposta.Codice · RRisposta.CorpoRResponse.Status · RResponse.Body
RErroreHttp.CodiceRHttpError.Status
RMessaggioErrore.Errore (JSON "errore")RErrorMessage.Error (JSON "error")