/ src / Ryujinx / UI / Views / User / UserEditorView.axaml
UserEditorView.axaml
  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:DataType="models:TempProfile">
 17      <UserControl.Resources>
 18          <helpers:BitmapArrayValueConverter x:Key="ByteImage" />
 19      </UserControl.Resources>
 20      <Grid Margin="0">
 21          <Grid.ColumnDefinitions>
 22              <ColumnDefinition Width="Auto" />
 23              <ColumnDefinition />
 24          </Grid.ColumnDefinitions>
 25          <Grid.RowDefinitions>
 26              <RowDefinition Height="*" />
 27              <RowDefinition Height="Auto" />
 28          </Grid.RowDefinitions>
 29          <StackPanel
 30              Grid.Row="0"
 31              Grid.Column="0"
 32              HorizontalAlignment="Stretch"
 33              Orientation="Vertical"
 34              Spacing="10">
 35              <TextBlock Text="{locale:Locale UserProfilesName}" />
 36              <TextBox
 37                  Name="NameBox"
 38                  Width="300"
 39                  HorizontalAlignment="Stretch"
 40                  MaxLength="{Binding MaxProfileNameLength}"
 41                  Watermark="{locale:Locale ProfileNameSelectionWatermark}"
 42                  Text="{Binding Name}" />
 43              <TextBlock Name="IdText" Text="{locale:Locale UserProfilesUserId}" />
 44              <TextBox
 45                  Name="IdLabel"
 46                  Width="300"
 47                  HorizontalAlignment="Stretch"
 48                  IsReadOnly="True"
 49                  Text="{Binding UserIdString}" />
 50          </StackPanel>
 51          <StackPanel
 52              Grid.Row="0"
 53              Grid.Column="1"
 54              HorizontalAlignment="Right"
 55              VerticalAlignment="Stretch"
 56              Orientation="Vertical">
 57              <Border
 58                  BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
 59                  BorderThickness="1">
 60                  <Panel>
 61                      <ui:SymbolIcon
 62                          FontSize="60"
 63                          Width="96"
 64                          Height="96"
 65                          Margin="0"
 66                          Foreground="{DynamicResource AppListHoverBackgroundColor}"
 67                          HorizontalAlignment="Stretch"
 68                          VerticalAlignment="Top"
 69                          Symbol="Camera" />
 70                      <Image
 71                          Name="ProfileImage"
 72                          Width="96"
 73                          Height="96"
 74                          Margin="0"
 75                          HorizontalAlignment="Stretch"
 76                          VerticalAlignment="Top"
 77                          Source="{Binding Image, Converter={StaticResource ByteImage}}" />
 78                  </Panel>
 79              </Border>
 80          </StackPanel>
 81          <StackPanel
 82              Grid.Row="1"
 83              Grid.Column="0"
 84              Grid.ColumnSpan="2"
 85              HorizontalAlignment="Left"
 86              Orientation="Horizontal"
 87              Margin="0 24 0 0"
 88              Spacing="10">
 89              <Button
 90                  Width="50"
 91                  MinWidth="50"
 92                  Click="BackButton_Click">
 93                  <ui:SymbolIcon Symbol="Back" />
 94              </Button>
 95          </StackPanel>
 96          <StackPanel
 97              Grid.Row="1"
 98              Grid.Column="0"
 99              Grid.ColumnSpan="2"
100              HorizontalAlignment="Right"
101              Orientation="Horizontal"
102              Margin="0 24 0 0"
103              Spacing="10">
104              <Button
105                  Name="DeleteButton"
106                  Click="DeleteButton_Click"
107                  Content="{locale:Locale UserProfilesDelete}" />
108              <Button
109                  Name="ChangePictureButton"
110                  Click="ChangePictureButton_Click"
111                  Content="{locale:Locale UserProfilesChangeProfileImage}" />
112              <Button
113                  Name="AddPictureButton"
114                  Click="ChangePictureButton_Click"
115                  Content="{locale:Locale UserProfilesSetProfileImage}" />
116              <Button
117                  Name="SaveButton"
118                  Click="SaveButton_Click"
119                  Content="{locale:Locale Save}" />
120          </StackPanel>
121      </Grid>
122  </UserControl>