This commit is contained in:
Wiesław Šoltés 2022-08-26 09:33:13 +02:00 коммит произвёл GitHub
Родитель f62d952ee9
Коммит cd245f27a0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 27 добавлений и 14 удалений

Просмотреть файл

@ -14,25 +14,38 @@ https://user-images.githubusercontent.com/2297442/132313187-32f18c4b-e894-46db-9
```
```C#
Window Build() => Window().Content(Label().Content("Minimal Avalonia"));
AppBuilder.Configure<Application>()
.UsePlatformDetect()
.UseFluentTheme()
.StartWithClassicDesktopLifetime(desktop => {
desktop.MainWindow = new Window {
Content = new Label { Content = "Minimal Avalonia" }
};
}, args);
.UsePlatformDetect()
.UseFluentTheme()
.StartWithClassicDesktopLifetime(Build, args);
```
```C#
var count = 0;
Window Build()
=> Window(out var window)
.Title("MinimalAvalonia").Width(400).Height(300)
.Content(
StackPanel()
.Children(
Button(out var button)
.Content("Welcome to Avalonia, please click me!"),
TextBox(out var tb1)
.Text("Minimal Avalonia"),
TextBox()
.Text(window.BindTitle()),
Label()
.Content(button.ObserveOnClick().Select(_ => ++count).Select(x => $"You clicked {x} times."))))
.Title(tb1.ObserveText().Select(x => x?.ToUpper()));
AppBuilder.Configure<Application>()
.UsePlatformDetect()
.UseFluentTheme()
.StartWithClassicDesktopLifetime(desktop => {
var window = new Window { Title = "Minimal Avalonia" };
window.Content = new TextBox { [!!TextBlock.TextProperty] = window[!!Window.TitleProperty] };
desktop.MainWindow = window;
}, args);
.UsePlatformDetect()
.UseFluentTheme()
.WithApplicationName("MinimalAvalonia")
.StartWithClassicDesktopLifetime(Build, args);
```
# Generate