mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-05-15 20:37:43 +02:00

 --------- Co-authored-by: MutantAura <domw0401@gmail.com>
105 lines
4.7 KiB
XML
105 lines
4.7 KiB
XML
<UserControl
|
|
x:Class="Ryujinx.Ava.UI.Applet.ProfileSelectorDialog"
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
|
xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
|
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
|
d:DesignHeight="450"
|
|
MinWidth="500"
|
|
d:DesignWidth="800"
|
|
mc:Ignorable="d"
|
|
Focusable="True"
|
|
x:DataType="viewModels:ProfileSelectorDialogViewModel">
|
|
<Design.DataContext>
|
|
<viewModels:ProfileSelectorDialogViewModel />
|
|
</Design.DataContext>
|
|
|
|
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RowDefinitions="*,Auto">
|
|
|
|
<Border
|
|
CornerRadius="5"
|
|
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
|
|
BorderThickness="1">
|
|
|
|
<ListBox
|
|
MaxHeight="300"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Center"
|
|
Background="Transparent"
|
|
ItemsSource="{Binding Profiles}"
|
|
SelectionChanged="ProfilesList_SelectionChanged">
|
|
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
|
|
<ListBox.Styles>
|
|
<Style Selector="ListBoxItem">
|
|
<Setter Property="Margin" Value="5 5 0 5" />
|
|
<Setter Property="CornerRadius" Value="5" />
|
|
</Style>
|
|
<Style Selector="Rectangle#SelectionIndicator">
|
|
<Setter Property="Opacity" Value="0" />
|
|
</Style>
|
|
</ListBox.Styles>
|
|
|
|
<ListBox.DataTemplates>
|
|
<DataTemplate
|
|
DataType="models:UserProfile">
|
|
<Grid
|
|
PointerEntered="Grid_PointerEntered"
|
|
PointerExited="Grid_OnPointerExited">
|
|
<Border
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
ClipToBounds="True"
|
|
CornerRadius="5"
|
|
Background="{Binding BackgroundColor}">
|
|
<StackPanel
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch">
|
|
<Image
|
|
Width="96"
|
|
Height="96"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Top"
|
|
Source="{Binding Image, Converter={x:Static helpers:BitmapArrayValueConverter.Instance}}" />
|
|
<TextBlock
|
|
HorizontalAlignment="Stretch"
|
|
MaxWidth="90"
|
|
Text="{Binding Name}"
|
|
TextAlignment="Center"
|
|
TextWrapping="Wrap"
|
|
TextTrimming="CharacterEllipsis"
|
|
MaxLines="2"
|
|
Margin="5" />
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
</DataTemplate>
|
|
<DataTemplate
|
|
DataType="viewModels:BaseModel">
|
|
<Panel
|
|
Height="118"
|
|
Width="96">
|
|
<Panel.Styles>
|
|
<Style Selector="Panel">
|
|
<Setter Property="Background" Value="{DynamicResource ListBoxBackground}" />
|
|
</Style>
|
|
</Panel.Styles>
|
|
</Panel>
|
|
</DataTemplate>
|
|
</ListBox.DataTemplates>
|
|
</ListBox>
|
|
</Border>
|
|
|
|
</Grid>
|
|
</UserControl>
|