MainWindow.axaml 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. <Window xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:vm="using:AvaloniaApplicationTest.ViewModels"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  7. x:Class="AvaloniaApplicationTest.Views.MainWindow"
  8. x:DataType="vm:MainWindowViewModel"
  9. Icon="/Assets/avalonia-logo.ico"
  10. Title="AvaloniaApplicationTest">
  11. <Window.Styles>
  12. <Style Selector="TextBlock">
  13. <Setter Property="FontSize" Value="36"/>
  14. </Style>
  15. </Window.Styles>
  16. <Design.DataContext>
  17. <!-- This only sets the DataContext for the previewer in an IDE,
  18. to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
  19. <vm:MainWindowViewModel/>
  20. </Design.DataContext>
  21. <StackPanel>
  22. <TextBlock Text="{Binding Count}"></TextBlock>
  23. <Button Command="{Binding AddCount}">Увеличить на 1</Button>
  24. <TextBlock Text="{Binding #cm1.SelectedValue}"></TextBlock>
  25. <ComboBox x:Name="cm1" ItemsSource="{Binding Surname}"></ComboBox>
  26. <TextBox Text="{Binding Message}"></TextBox>
  27. <TextBlock Text="{Binding Message}"></TextBlock>
  28. <Button Command="{Binding CreateCaptcha}">Сгенерировать</Button>
  29. <UserControl Content="{Binding Can}"></UserControl>
  30. </StackPanel>
  31. </Window>