|
@@ -3,7 +3,7 @@
|
|
|
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="800" d:DesignHeight="450"
|
|
|
+ mc:Ignorable="d" d:DesignWidth="1400" d:DesignHeight="800"
|
|
|
x:Class="AvaloniaApplicationTestNew.Views.UserPage"
|
|
|
x:DataType="vm:MainWindowViewModel"
|
|
|
xmlns:conv="using:AvaloniaApplicationTestNew.Resources">
|
|
@@ -11,25 +11,49 @@
|
|
|
<conv:DateConverter x:Key="myDateTimeOffset"/>
|
|
|
<conv:ImageConverter x:Key="myByteaBitmap"/>
|
|
|
</UserControl.Resources>
|
|
|
- <StackPanel VerticalAlignment="Center">
|
|
|
- <Image Source="{Binding UserPageVM.Current_user.Image, Converter={StaticResource myByteaBitmap}}" Width="200" Height="200"/>
|
|
|
- <!--<Image Source="{Binding UserPageVM.ImageUser}" Width="200" Height="200"/>-->
|
|
|
- <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}"/>
|
|
|
- </StackPanel>
|
|
|
+ <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>
|
|
|
|