UsersMainPage.axaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="AvaloniaApplication1.UsersMainPage"
  7. xmlns:vm="using:AvaloniaApplication1.ViewModels"
  8. x:DataType="vm:MainPageViewModel"
  9. xmlns:conv="using:AvaloniaApplication1.Resources">
  10. <UserControl.Resources>
  11. <conv:ImageConverter x:Key="myImageConverter"/>
  12. </UserControl.Resources>
  13. <Grid RowDefinitions="50,*" Grid.Column="1" Grid.Row="1">
  14. <StackPanel Orientation="Horizontal">
  15. <TextBox Text="{Binding Search}" Width="200" Watermark="Введите имя: "></TextBox>
  16. <ComboBox ItemsSource="{Binding Genders}" SelectedItem="{Binding SelectedGender}">
  17. <ComboBox.ItemTemplate>
  18. <DataTemplate>
  19. <TextBlock Text="{Binding Title}"/>
  20. </DataTemplate>
  21. </ComboBox.ItemTemplate>
  22. </ComboBox>
  23. <StackPanel Orientation="Horizontal">
  24. <RadioButton Content="По возрастанию" Command="{Binding OrderByAge}" CommandParameter="1"></RadioButton>
  25. <RadioButton Content="По убыванию" Command="{Binding OrderByAge}" CommandParameter="2"></RadioButton>
  26. </StackPanel>
  27. </StackPanel>
  28. <ListBox ItemsSource="{Binding Smeshariki}" Grid.Row="1">
  29. <ListBox.ItemTemplate>
  30. <DataTemplate>
  31. <StackPanel Orientation="Horizontal">
  32. <Image Source="{Binding Image, Converter= {StaticResource myImageConverter}}" Width="100" Height="100"/>
  33. <StackPanel>
  34. <TextBlock Text="{Binding Name, StringFormat= Имя: {0}}"></TextBlock>
  35. <TextBlock Text="{Binding Animal, StringFormat= Животное: {0}}"></TextBlock>
  36. <TextBlock Text="{Binding Age, StringFormat= Возраст: {0}}"></TextBlock>
  37. <TextBlock Text="{Binding GenderNavigation.Title, StringFormat= Пол: {0}}"></TextBlock>
  38. </StackPanel>
  39. </StackPanel>
  40. </DataTemplate>
  41. </ListBox.ItemTemplate>
  42. </ListBox>
  43. </Grid>
  44. </UserControl>