123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <UserControl xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="AvaloniaApplication1.UsersMainPage"
- xmlns:vm="using:AvaloniaApplication1.ViewModels"
- x:DataType="vm:MainPageViewModel"
- xmlns:conv="using:AvaloniaApplication1.Resources">
- <UserControl.Resources>
- <conv:ImageConverter x:Key="myImageConverter"/>
- </UserControl.Resources>
- <Grid RowDefinitions="50,*" Grid.Column="1" Grid.Row="1">
- <StackPanel Orientation="Horizontal">
- <TextBox Text="{Binding Search}" Width="200" Watermark="Введите имя: "></TextBox>
- <ComboBox ItemsSource="{Binding Genders}" SelectedItem="{Binding SelectedGender}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Title}"/>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <StackPanel Orientation="Horizontal">
- <RadioButton Content="По возрастанию" Command="{Binding OrderByAge}" CommandParameter="1"></RadioButton>
- <RadioButton Content="По убыванию" Command="{Binding OrderByAge}" CommandParameter="2"></RadioButton>
- </StackPanel>
- </StackPanel>
- <ListBox ItemsSource="{Binding Smeshariki}" Grid.Row="1">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <Image Source="{Binding Image, Converter= {StaticResource myImageConverter}}" Width="100" Height="100"/>
- <StackPanel>
- <TextBlock Text="{Binding Name, StringFormat= Имя: {0}}"></TextBlock>
- <TextBlock Text="{Binding Animal, StringFormat= Животное: {0}}"></TextBlock>
- <TextBlock Text="{Binding Age, StringFormat= Возраст: {0}}"></TextBlock>
- <TextBlock Text="{Binding GenderNavigation.Title, StringFormat= Пол: {0}}"></TextBlock>
- </StackPanel>
- </StackPanel>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
- </UserControl>
|