## Структура и пространства имен AXAML
```
Welcome to Avalonia!
```
![](./img/1.jpg)
## Элементы и их атрибуты
```
```
![](./img/2.jpg)
Конпка с пробелом xml:space="preserve"
![](./img/3.jpg)
## Взаимодействие кода C# и XAML
```
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfApp1
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button1_Click(object sender, RoutedEventArgs e)
{
// Создаем новое окно
Window messageWindow = new Window
{
Title = "Сообщение",
Width = 200,
Height = 100,
WindowStartupLocation = WindowStartupLocation.CenterScreen,
Content = new Label
{
Content = "Колесников Е.И. лучший перпод всея руси)",
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center
}
};
// Отобразить окно как диалог
messageWindow.ShowDialog();
}
}
}
```
```
```
![](./img/4.jpg)
## Пространства имен из C# в XAML
```
namespace WpfApp1
{
public class Phone
{
public string Name { get; set; }
public int Price { get; set; }
public override string ToString()
{
return $"Смартфон {this.Name}; цена: {this.Price}";
}
}
}
```
```
```
![](./img/5.jpg)
## Компоновка
```
```
![](./img/6.jpg)
```
```
![](./img/7.jpg)
## GridSplitter
```
```
![](./img/8.jpg)
## StackPanel
```
```
![](./img/9.jpg)
## WrapPanel
```
```
![](./img/10.jpg)
## Image. Ресурсы
```
```
![](./img/11.jpg)