MainViewControls.axaml
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 6 xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls" 7 xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" 8 xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" 9 xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" 10 xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" 11 mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" 12 x:Class="Ryujinx.Ava.UI.Views.Main.MainViewControls" 13 x:DataType="viewModels:MainWindowViewModel"> 14 <Design.DataContext> 15 <viewModels:MainWindowViewModel /> 16 </Design.DataContext> 17 <DockPanel 18 Margin="0,0,0,5" 19 Height="35" 20 HorizontalAlignment="Stretch"> 21 <Button 22 Width="40" 23 MinWidth="40" 24 Margin="5,2,0,2" 25 VerticalAlignment="Stretch" 26 Command="{Binding SetListMode}" 27 IsEnabled="{Binding IsGrid}"> 28 <ui:FontIcon 29 Margin="0" 30 HorizontalAlignment="Stretch" 31 VerticalAlignment="Center" 32 FontFamily="avares://FluentAvalonia/Fonts#Symbols" 33 Glyph="{helpers:GlyphValueConverter List}" /> 34 </Button> 35 <Button 36 Width="40" 37 MinWidth="40" 38 Margin="5,2,5,2" 39 VerticalAlignment="Stretch" 40 Command="{Binding SetGridMode}" 41 IsEnabled="{Binding IsList}"> 42 <ui:FontIcon 43 Margin="0" 44 HorizontalAlignment="Stretch" 45 VerticalAlignment="Center" 46 FontFamily="avares://FluentAvalonia/Fonts#Symbols" 47 Glyph="{helpers:GlyphValueConverter Grid}" /> 48 </Button> 49 <TextBlock 50 Margin="10,0" 51 VerticalAlignment="Center" 52 Text="{locale:Locale IconSize}" 53 ToolTip.Tip="{locale:Locale IconSizeTooltip}" /> 54 <controls:SliderScroll 55 Width="150" 56 Height="35" 57 Margin="5,-10,5,0" 58 VerticalAlignment="Center" 59 IsSnapToTickEnabled="True" 60 SmallChange="1" 61 Maximum="4" 62 Minimum="1" 63 TickFrequency="1" 64 ToolTip.Tip="{locale:Locale IconSizeTooltip}" 65 Value="{Binding GridSizeScale}" /> 66 <CheckBox 67 Margin="0" 68 VerticalAlignment="Center" 69 IsChecked="{Binding ShowNames, Mode=TwoWay}" 70 IsVisible="{Binding IsGrid}"> 71 <TextBlock Margin="5,3,0,0" Text="{locale:Locale CommonShowNames}" /> 72 </CheckBox> 73 <TextBox 74 Name="SearchBox" 75 MinWidth="200" 76 Margin="5,0,5,0" 77 HorizontalAlignment="Right" 78 VerticalAlignment="Center" 79 DockPanel.Dock="Right" 80 KeyUp="SearchBox_OnKeyUp" 81 Text="{Binding SearchText}" 82 Watermark="{locale:Locale MenuSearch}" /> 83 <DropDownButton 84 Width="150" 85 HorizontalAlignment="Right" 86 VerticalAlignment="Center" 87 Content="{Binding SortName}" 88 DockPanel.Dock="Right"> 89 <DropDownButton.Flyout> 90 <Flyout Placement="Bottom"> 91 <StackPanel 92 Margin="0" 93 HorizontalAlignment="Stretch" 94 Orientation="Vertical"> 95 <StackPanel> 96 <RadioButton 97 Checked="Sort_Checked" 98 Content="{locale:Locale CommonFavorite}" 99 GroupName="Sort" 100 IsChecked="{Binding IsSortedByFavorite, Mode=OneTime}" 101 Tag="Favorite" /> 102 <RadioButton 103 Checked="Sort_Checked" 104 Content="{locale:Locale GameListHeaderApplication}" 105 GroupName="Sort" 106 IsChecked="{Binding IsSortedByTitle, Mode=OneTime}" 107 Tag="Title" /> 108 <RadioButton 109 Checked="Sort_Checked" 110 Content="{locale:Locale GameListHeaderDeveloper}" 111 GroupName="Sort" 112 IsChecked="{Binding IsSortedByDeveloper, Mode=OneTime}" 113 Tag="Developer" /> 114 <RadioButton 115 Checked="Sort_Checked" 116 Content="{locale:Locale GameListHeaderTimePlayed}" 117 GroupName="Sort" 118 IsChecked="{Binding IsSortedByTimePlayed, Mode=OneTime}" 119 Tag="TotalTimePlayed" /> 120 <RadioButton 121 Checked="Sort_Checked" 122 Content="{locale:Locale GameListHeaderLastPlayed}" 123 GroupName="Sort" 124 IsChecked="{Binding IsSortedByLastPlayed, Mode=OneTime}" 125 Tag="LastPlayed" /> 126 <RadioButton 127 Checked="Sort_Checked" 128 Content="{locale:Locale GameListHeaderFileExtension}" 129 GroupName="Sort" 130 IsChecked="{Binding IsSortedByType, Mode=OneTime}" 131 Tag="FileType" /> 132 <RadioButton 133 Checked="Sort_Checked" 134 Content="{locale:Locale GameListHeaderFileSize}" 135 GroupName="Sort" 136 IsChecked="{Binding IsSortedBySize, Mode=OneTime}" 137 Tag="FileSize" /> 138 <RadioButton 139 Checked="Sort_Checked" 140 Content="{locale:Locale GameListHeaderPath}" 141 GroupName="Sort" 142 IsChecked="{Binding IsSortedByPath, Mode=OneTime}" 143 Tag="Path" /> 144 </StackPanel> 145 <Border 146 Width="60" 147 Height="2" 148 Margin="5" 149 HorizontalAlignment="Stretch" 150 BorderBrush="White" 151 BorderThickness="0,1,0,0"> 152 <Separator Height="0" HorizontalAlignment="Stretch" /> 153 </Border> 154 <RadioButton 155 Checked="Order_Checked" 156 Content="{locale:Locale OrderAscending}" 157 GroupName="Order" 158 IsChecked="{Binding IsAscending, Mode=OneTime}" 159 Tag="Ascending" /> 160 <RadioButton 161 Checked="Order_Checked" 162 Content="{locale:Locale OrderDescending}" 163 GroupName="Order" 164 IsChecked="{Binding !IsAscending, Mode=OneTime}" 165 Tag="Descending" /> 166 </StackPanel> 167 </Flyout> 168 </DropDownButton.Flyout> 169 </DropDownButton> 170 <TextBlock 171 Margin="10,0" 172 HorizontalAlignment="Right" 173 VerticalAlignment="Center" 174 DockPanel.Dock="Right" 175 Text="{locale:Locale CommonSort}" /> 176 </DockPanel> 177 </UserControl>