UserEditorView.axaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <UserControl
  2. x:Class="Ryujinx.Ava.UI.Views.User.UserEditorView"
  3. xmlns="https://github.com/avaloniaui"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
  10. xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
  11. Margin="0"
  12. MinWidth="500"
  13. Padding="0"
  14. mc:Ignorable="d"
  15. Focusable="True"
  16. x:CompileBindings="True"
  17. x:DataType="models:TempProfile">
  18. <UserControl.Resources>
  19. <helpers:BitmapArrayValueConverter x:Key="ByteImage" />
  20. </UserControl.Resources>
  21. <Grid Margin="0">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="Auto" />
  24. <ColumnDefinition />
  25. </Grid.ColumnDefinitions>
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="*" />
  28. <RowDefinition Height="Auto" />
  29. </Grid.RowDefinitions>
  30. <StackPanel
  31. Grid.Row="0"
  32. Grid.Column="0"
  33. HorizontalAlignment="Stretch"
  34. Orientation="Vertical"
  35. Spacing="10">
  36. <TextBlock Text="{locale:Locale UserProfilesName}" />
  37. <TextBox
  38. Name="NameBox"
  39. Width="300"
  40. HorizontalAlignment="Stretch"
  41. MaxLength="{Binding MaxProfileNameLength}"
  42. Watermark="{locale:Locale ProfileNameSelectionWatermark}"
  43. Text="{Binding Name}" />
  44. <TextBlock Name="IdText" Text="{locale:Locale UserProfilesUserId}" />
  45. <TextBox
  46. Name="IdLabel"
  47. Width="300"
  48. HorizontalAlignment="Stretch"
  49. IsReadOnly="True"
  50. Text="{Binding UserIdString}" />
  51. </StackPanel>
  52. <StackPanel
  53. Grid.Row="0"
  54. Grid.Column="1"
  55. HorizontalAlignment="Right"
  56. VerticalAlignment="Stretch"
  57. Orientation="Vertical">
  58. <Border
  59. BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
  60. BorderThickness="1">
  61. <Panel>
  62. <ui:SymbolIcon
  63. FontSize="60"
  64. Width="96"
  65. Height="96"
  66. Margin="0"
  67. Foreground="{DynamicResource AppListHoverBackgroundColor}"
  68. HorizontalAlignment="Stretch"
  69. VerticalAlignment="Top"
  70. Symbol="Camera" />
  71. <Image
  72. Name="ProfileImage"
  73. Width="96"
  74. Height="96"
  75. Margin="0"
  76. HorizontalAlignment="Stretch"
  77. VerticalAlignment="Top"
  78. Source="{Binding Image, Converter={StaticResource ByteImage}}" />
  79. </Panel>
  80. </Border>
  81. </StackPanel>
  82. <StackPanel
  83. Grid.Row="1"
  84. Grid.Column="0"
  85. Grid.ColumnSpan="2"
  86. HorizontalAlignment="Left"
  87. Orientation="Horizontal"
  88. Margin="0 24 0 0"
  89. Spacing="10">
  90. <Button
  91. Width="50"
  92. MinWidth="50"
  93. Click="BackButton_Click">
  94. <ui:SymbolIcon Symbol="Back" />
  95. </Button>
  96. </StackPanel>
  97. <StackPanel
  98. Grid.Row="1"
  99. Grid.Column="0"
  100. Grid.ColumnSpan="2"
  101. HorizontalAlignment="Right"
  102. Orientation="Horizontal"
  103. Margin="0 24 0 0"
  104. Spacing="10">
  105. <Button
  106. Name="DeleteButton"
  107. Click="DeleteButton_Click"
  108. Content="{locale:Locale UserProfilesDelete}" />
  109. <Button
  110. Name="ChangePictureButton"
  111. Click="ChangePictureButton_Click"
  112. Content="{locale:Locale UserProfilesChangeProfileImage}" />
  113. <Button
  114. Name="AddPictureButton"
  115. Click="ChangePictureButton_Click"
  116. Content="{locale:Locale UserProfilesSetProfileImage}" />
  117. <Button
  118. Name="SaveButton"
  119. Click="SaveButton_Click"
  120. Content="{locale:Locale Save}" />
  121. </StackPanel>
  122. </Grid>
  123. </UserControl>