mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-28 23:07:11 +02:00
misc: chore: Use static instances of converters instead of using control resources
This commit is contained in:
parent
a469f3d710
commit
191e158289
20 changed files with 82 additions and 134 deletions
|
@ -30,9 +30,6 @@
|
|||
<Design.DataContext>
|
||||
<viewModels:MainWindowViewModel />
|
||||
</Design.DataContext>
|
||||
<Window.Resources>
|
||||
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||
</Window.Resources>
|
||||
<Window.KeyBindings>
|
||||
<KeyBinding Gesture="Alt+Return" Command="{Binding ToggleFullscreen}" />
|
||||
<KeyBinding Gesture="F11" Command="{Binding ToggleFullscreen}" />
|
||||
|
@ -121,7 +118,7 @@
|
|||
Width="256"
|
||||
Height="256"
|
||||
IsVisible="{Binding ShowLoadProgress}"
|
||||
Source="{Binding SelectedIcon, Converter={StaticResource ByteImage}}" />
|
||||
Source="{Binding SelectedIcon, Converter={x:Static helpers:BitmapArrayValueConverter.Instance}}" />
|
||||
</Border>
|
||||
<Grid
|
||||
Grid.Column="1"
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
mc:Ignorable="d"
|
||||
x:DataType="viewModels:TitleUpdateViewModel"
|
||||
Focusable="True">
|
||||
<UserControl.Resources>
|
||||
<helpers:TitleUpdateLabelConverter x:Key="TitleUpdateLabel" />
|
||||
</UserControl.Resources>
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
|
@ -57,7 +54,7 @@
|
|||
VerticalAlignment="Center"
|
||||
TextWrapping="Wrap">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding Converter="{StaticResource TitleUpdateLabel}">
|
||||
<MultiBinding Converter="{x:Static helpers:TitleUpdateLabelConverter.Instance}">
|
||||
<Binding Path="DisplayVersion" />
|
||||
<Binding Path="IsBundled" />
|
||||
</MultiBinding>
|
||||
|
|
|
@ -13,11 +13,6 @@
|
|||
x:DataType="viewModels:XCITrimmerViewModel"
|
||||
Focusable="True"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<helpers:XCITrimmerFileStatusConverter x:Key="StatusLabel" />
|
||||
<helpers:XCITrimmerFileStatusDetailConverter x:Key="StatusDetailLabel" />
|
||||
<helpers:XCITrimmerFileSpaceSavingsConverter x:Key="SpaceSavingsLabel" />
|
||||
</UserControl.Resources>
|
||||
<Grid Margin="20 0 20 0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -186,7 +181,7 @@
|
|||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="1"
|
||||
Text="{Binding ., Converter={StaticResource StatusLabel}}">
|
||||
Text="{Binding ., Converter={x:Static helpers:XCITrimmerFileStatusConverter.Instance}}">
|
||||
<ToolTip.Tip>
|
||||
<StackPanel
|
||||
IsVisible="{Binding IsFailed}">
|
||||
|
@ -194,7 +189,7 @@
|
|||
Classes="h1"
|
||||
Text="{ext:Locale XCITrimmerTitleStatusFailed}" />
|
||||
<TextBlock
|
||||
Text="{Binding ., Converter={StaticResource StatusDetailLabel}}"
|
||||
Text="{Binding ., Converter={x:Static helpers:XCITrimmerFileStatusDetailConverter.Instance}}"
|
||||
MaxLines="5"
|
||||
MaxWidth="200"
|
||||
MaxHeight="100"
|
||||
|
@ -209,7 +204,7 @@
|
|||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="1"
|
||||
Text="{Binding ., Converter={StaticResource SpaceSavingsLabel}}">>
|
||||
Text="{Binding ., Converter={x:Static helpers:XCITrimmerFileSpaceSavingsConverter.Instance}}">>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue