UserFirmwareAvatarSelectorView.axaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <UserControl
  2. xmlns="https://github.com/avaloniaui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. mc:Ignorable="d"
  8. Width="528"
  9. d:DesignWidth="578"
  10. d:DesignHeight="350"
  11. x:Class="Ryujinx.Ava.UI.Views.User.UserFirmwareAvatarSelectorView"
  12. xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
  13. xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
  14. xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
  15. x:CompileBindings="True"
  16. x:DataType="viewModels:UserFirmwareAvatarSelectorViewModel"
  17. Focusable="True">
  18. <Design.DataContext>
  19. <viewModels:UserFirmwareAvatarSelectorViewModel />
  20. </Design.DataContext>
  21. <UserControl.Resources>
  22. <helpers:BitmapArrayValueConverter x:Key="ByteImage" />
  23. </UserControl.Resources>
  24. <Grid
  25. Margin="0"
  26. HorizontalAlignment="Stretch"
  27. VerticalAlignment="Stretch">
  28. <Grid.RowDefinitions>
  29. <RowDefinition Height="Auto" />
  30. <RowDefinition Height="*" />
  31. <RowDefinition Height="Auto" />
  32. <RowDefinition Height="Auto" />
  33. </Grid.RowDefinitions>
  34. <ListBox
  35. Grid.Row="1"
  36. BorderThickness="0"
  37. SelectedIndex="{Binding SelectedIndex}"
  38. Height="400"
  39. Items="{Binding Images}"
  40. HorizontalAlignment="Stretch"
  41. VerticalAlignment="Center">
  42. <ListBox.ItemsPanel>
  43. <ItemsPanelTemplate>
  44. <WrapPanel
  45. Orientation="Horizontal"
  46. Margin="0"
  47. HorizontalAlignment="Center" />
  48. </ItemsPanelTemplate>
  49. </ListBox.ItemsPanel>
  50. <ListBox.Styles>
  51. <Style Selector="ListBoxItem">
  52. <Setter Property="CornerRadius" Value="4" />
  53. <Setter Property="Width" Value="85" />
  54. <Setter Property="MaxWidth" Value="85" />
  55. <Setter Property="MinWidth" Value="85" />
  56. </Style>
  57. <Style Selector="ListBoxItem /template/ Border#SelectionIndicator">
  58. <Setter Property="MinHeight" Value="70" />
  59. </Style>
  60. </ListBox.Styles>
  61. <ListBox.ItemTemplate>
  62. <DataTemplate>
  63. <Panel
  64. Background="{Binding BackgroundColor}"
  65. Margin="5">
  66. <Image Source="{Binding Data, Converter={StaticResource ByteImage}}" />
  67. </Panel>
  68. </DataTemplate>
  69. </ListBox.ItemTemplate>
  70. </ListBox>
  71. <StackPanel
  72. Grid.Row="3"
  73. Orientation="Horizontal"
  74. Spacing="10"
  75. Margin="0 24 0 0"
  76. HorizontalAlignment="Left">
  77. <Button
  78. Width="50"
  79. MinWidth="50"
  80. Height="35"
  81. Click="GoBack">
  82. <ui:SymbolIcon Symbol="Back" />
  83. </Button>
  84. </StackPanel>
  85. <StackPanel
  86. Grid.Row="3"
  87. Orientation="Horizontal"
  88. Spacing="10"
  89. Margin="0 24 0 0"
  90. HorizontalAlignment="Right">
  91. <ui:ColorPickerButton
  92. FlyoutPlacement="Top"
  93. IsMoreButtonVisible="False"
  94. UseColorPalette="False"
  95. UseColorTriangle="False"
  96. UseColorWheel="False"
  97. ShowAcceptDismissButtons="False"
  98. IsAlphaEnabled="False"
  99. Color="{Binding BackgroundColor, Mode=TwoWay}"
  100. Name="ColorButton">
  101. <ui:ColorPickerButton.Styles>
  102. <Style Selector="Grid#Root > DockPanel > Grid">
  103. <Setter Property="IsVisible" Value="False" />
  104. </Style>
  105. </ui:ColorPickerButton.Styles>
  106. </ui:ColorPickerButton>
  107. <Button
  108. Content="{locale:Locale AvatarChoose}"
  109. Height="35"
  110. Name="ChooseButton"
  111. Click="ChooseButton_OnClick" />
  112. </StackPanel>
  113. </Grid>
  114. </UserControl>