AddUserPage.axaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:vm="using:AvaloniaApplicationTestNew.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="AvaloniaApplicationTestNew.Views.AddUserPage"
  8. x:DataType="vm:MainWindowViewModel"
  9. xmlns:conv="using:AvaloniaApplicationTestNew.Resources">
  10. <UserControl.Resources>
  11. <conv:DateConverter x:Key="myDateTimeOffset"/>
  12. </UserControl.Resources>
  13. <StackPanel VerticalAlignment="Center">
  14. <TextBox Watermark="Логин" Text="{Binding AddUserPageVM.NewLogined.Login}"/>
  15. <TextBox Watermark="Пароль" Text="{Binding AddUserPageVM.NewLogined.Password}"/>
  16. <ComboBox ItemsSource="{Binding AddUserPageVM.RoleList}" SelectedItem="{Binding AddUserPageVM.NewLogined.IdRoleNavigation}">
  17. <ComboBox.ItemTemplate>
  18. <DataTemplate>
  19. <TextBlock Text="{Binding RoleName}" />
  20. </DataTemplate>
  21. </ComboBox.ItemTemplate>
  22. </ComboBox>
  23. <TextBox Watermark="Имя пользователя" Text="{Binding AddUserPageVM.NewUser.Name}"/>
  24. <DatePicker SelectedDate="{Binding AddUserPageVM.NewUser.BirthDate, Converter={StaticResource myDateTimeOffset}}"/>
  25. <ComboBox ItemsSource="{Binding AddUserPageVM.GendersList}" SelectedItem="{Binding AddUserPageVM.NewUser.IdGenderNavigation}">
  26. <ComboBox.ItemTemplate>
  27. <DataTemplate>
  28. <TextBlock Text="{Binding Gender1}"/>
  29. </DataTemplate>
  30. </ComboBox.ItemTemplate>
  31. </ComboBox>
  32. <Button Content="Добавить изображение" Command="{Binding AddUserPageVM.Image}"/>
  33. <Button Content="Сохранить пользователя" Command="{Binding AddUserPageVM.CreateUser}"/>
  34. <Button Content="Назад" Command="{Binding AddUserPageVM.Back}"/>
  35. <TextBlock Text="{Binding AddUserPageVM.Message}" Foreground="Red"/>
  36. </StackPanel>
  37. </UserControl>