1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <UserControl xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:vm="using:AvaloniaApplicationTestNew.ViewModels"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="1400" d:DesignHeight="800"
- x:Class="AvaloniaApplicationTestNew.Views.UserPage"
- x:DataType="vm:MainWindowViewModel"
- xmlns:conv="using:AvaloniaApplicationTestNew.Resources">
- <UserControl.Resources>
- <conv:DateConverter x:Key="myDateTimeOffset"/>
- <conv:ImageConverter x:Key="myByteaBitmap"/>
- </UserControl.Resources>
- <Grid ColumnDefinitions="*,*" RowDefinitions="300, *">
- <StackPanel Grid.ColumnSpan="2" Grid.Row="0" Orientation="Vertical">
- <Image Source="{Binding UserPageVM.Current_user.Image, Converter={StaticResource myByteaBitmap}}" Width="200" Height="200"/>
- </StackPanel>
- <StackPanel Grid.Column="0" Grid.Row="1">
- <TextBox Watermark="Имя пользователя" Text="{Binding UserPageVM.Current_user.Name}"/>
- <DatePicker SelectedDate="{Binding UserPageVM.Current_user.BirthDate, Converter={StaticResource myDateTimeOffset}}"/>
- <ComboBox ItemsSource="{Binding UserPageVM.GendersList}" SelectedItem="{Binding UserPageVM.Current_user.IdGenderNavigation}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Gender1}"/>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <Button Content="Выбрать аватарку пользователя" Command="{Binding UserPageVM.Image}"/>
- <Button Content="Удалить изображение" Command="{Binding UserPageVM.DeleteImage}"/>
- <Button Content="Сохранить изменения" Command="{Binding UserPageVM.SaveAndChange}"/>
- <Button Content="Выйти" Command="{Binding UserPageVM.Back}" IsVisible="{Binding !IsButtonVisible}"/>
- <Button Content="Удалить пользователя" IsVisible="{Binding IsButtonVisible}" Command="{Binding DeleteUser}"/>
- <Button Content="Назад" IsVisible="{Binding IsButtonVisible}" Command="{Binding BackToList}"/>
- <TextBlock Text="{Binding UserPageVM.Message}" Foreground="Red"/>
- </StackPanel>
- <StackPanel Grid.Column="1" Orientation="Vertical" Grid.Row="1">
- <ComboBox ItemsSource="{Binding UserPageVM.WithoutTraits}" SelectedItem="{Binding UserPageVM.SelectTrait}" Grid.Column="1">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Traitname}"/>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <StackPanel Grid.Column="1">
- <Button Content="Добавить качество" Command="{Binding UserPageVM.AddTrait}"/>
- <Button Content="Удалить качество" Command="{Binding UserPageVM.DeleteTrait}"/>
- </StackPanel>
- <TextBlock Foreground="Red" IsVisible="{Binding UserPageVM.IsReadyToDelete}" Text="Сначала выделите качество из списка, нажав на него"/>
- <ListBox ItemsSource="{Binding UserPageVM.WithTraits}" SelectedItem="{Binding UserPageVM.SelectItem}" Grid.Column="1">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Traitname}"/>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </StackPanel>
- </Grid>
- </UserControl>
|