UserProfileWindow.axaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <window:StyleableWindow 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:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="350"
  7. x:Class="Ryujinx.Ava.Ui.Windows.UserProfileWindow"
  8. xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale"
  9. xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels"
  10. xmlns:controls="clr-namespace:Ryujinx.Ava.Ui.Controls"
  11. xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows"
  12. CanResize="False"
  13. Width="850" MinHeight="550" Height="550"
  14. WindowStartupLocation="CenterOwner"
  15. SizeToContent="Manual"
  16. MinWidth="600">
  17. <Design.DataContext>
  18. <viewModels:UserProfileViewModel />
  19. </Design.DataContext>
  20. <Window.Resources>
  21. <controls:BitmapArrayValueConverter x:Key="ByteImage" />
  22. </Window.Resources>
  23. <Grid Margin="15" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
  24. <Grid.RowDefinitions>
  25. <RowDefinition Height="Auto" />
  26. <RowDefinition Height="Auto" />
  27. <RowDefinition />
  28. <RowDefinition Height="Auto" />
  29. </Grid.RowDefinitions>
  30. <Grid Grid.Row="1">
  31. <Grid.RowDefinitions>
  32. <RowDefinition Height="Auto" />
  33. <RowDefinition />
  34. </Grid.RowDefinitions>
  35. <ContentControl
  36. Focusable="False"
  37. IsVisible="False"
  38. KeyboardNavigation.IsTabStop="False">
  39. <ui:ContentDialog Name="ContentDialog"
  40. IsPrimaryButtonEnabled="True"
  41. IsSecondaryButtonEnabled="True"
  42. IsVisible="False" />
  43. </ContentControl>
  44. <TextBlock Text="{Locale:Locale UserProfilesSelectedUserProfile}" />
  45. <Grid Grid.Row="1" Margin="10">
  46. <Grid.ColumnDefinitions>
  47. <ColumnDefinition Width="Auto" />
  48. <ColumnDefinition />
  49. <ColumnDefinition Width="Auto" />
  50. </Grid.ColumnDefinitions>
  51. <Image Height="96" Width="96"
  52. Source="{Binding SelectedProfile.Image, Converter={StaticResource ByteImage}}" />
  53. <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" Grid.Column="1" Spacing="10"
  54. Margin="5, 10">
  55. <TextBox Name="NameBox" Text="{Binding SelectedProfile.Name, Mode=OneWay}"
  56. HorizontalAlignment="Stretch" />
  57. <TextBlock Text="{Binding SelectedProfile.UserId}" />
  58. </StackPanel>
  59. <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" Grid.Column="2" Spacing="10"
  60. Margin="5">
  61. <Button Content="{Locale:Locale UserProfilesSaveProfileName}" Name="SetNameButton"
  62. Click="SetNameButton_OnClick" />
  63. <Button Name="SelectProfileImage" Command="{Binding ChooseProfileImage}"
  64. Content="{Locale:Locale UserProfilesChangeProfileImage}" />
  65. </StackPanel>
  66. </Grid>
  67. </Grid>
  68. <Grid Grid.Row="2">
  69. <Grid.RowDefinitions>
  70. <RowDefinition Height="Auto" />
  71. <RowDefinition />
  72. </Grid.RowDefinitions>
  73. <TextBlock Text="{Locale:Locale UserProfilesAvailableUserProfiles}" />
  74. <ListBox Grid.Row="1" Margin="10" Name="ProfilesList" DoubleTapped="ProfilesList_DoubleTapped"
  75. Items="{Binding Profiles}">
  76. <ListBox.ItemTemplate>
  77. <DataTemplate>
  78. <Grid HorizontalAlignment="Stretch">
  79. <Grid.ColumnDefinitions>
  80. <ColumnDefinition Width="Auto" />
  81. <ColumnDefinition />
  82. </Grid.ColumnDefinitions>
  83. <Grid Grid.Column="0" Background="{DynamicResource ThemeAccentColorBrush}"
  84. Grid.ColumnSpan="2"
  85. HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="5" MinWidth="5"
  86. IsVisible="{Binding IsOpened}" />
  87. <Image Grid.Column="0" Height="96" Width="96"
  88. Source="{Binding Image, Converter={StaticResource ByteImage}}" />
  89. <StackPanel Margin="10" Orientation="Vertical" HorizontalAlignment="Stretch"
  90. VerticalAlignment="Center" Grid.Column="1">
  91. <TextBlock Text="{Binding Name}" />
  92. <TextBlock Text="{Binding UserId}" />
  93. </StackPanel>
  94. </Grid>
  95. </DataTemplate>
  96. </ListBox.ItemTemplate>
  97. </ListBox>
  98. </Grid>
  99. <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="10,0" Spacing="10" HorizontalAlignment="Stretch">
  100. <Button Content="{Locale:Locale UserProfilesAddNewProfile}" Command="{Binding AddUser}" />
  101. <Button IsEnabled="{Binding IsSelectedProfileDeletable}"
  102. Content="{Locale:Locale UserProfilesDeleteSelectedProfile}" Command="{Binding DeleteUser}" />
  103. <Button HorizontalAlignment="Right" Content="{Locale:Locale UserProfilesClose}" Click="CloseButton_OnClick"
  104. Name="CloseButton" />
  105. </StackPanel>
  106. </Grid>
  107. </window:StyleableWindow>