Skip to content

Commit dc63e39

Browse files
committed
fix: warning about EnumConverters.Equals
1 parent 5f333fc commit dc63e39

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/Converters/EnumConverters.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/Views/CreateBranch.axaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
xmlns:vm="using:SourceGit.ViewModels"
77
xmlns:v="using:SourceGit.Views"
88
xmlns:c="using:SourceGit.Converters"
9+
xmlns:ac="using:Avalonia.Controls.Converters"
910
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="450"
1011
x:Class="SourceGit.Views.CreateBranch"
1112
x:DataType="vm:CreateBranch">
@@ -60,17 +61,21 @@
6061
Margin="0,0,8,0"
6162
Text="{DynamicResource Text.CreateBranch.LocalChanges}"/>
6263
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal">
64+
<StackPanel.Resources>
65+
<ac:EnumToBoolConverter x:Key="EnumToBoolConverter"/>
66+
</StackPanel.Resources>
67+
6368
<RadioButton Content="{DynamicResource Text.CreateBranch.LocalChanges.StashAndReply}"
6469
GroupName="LocalChanges"
65-
IsChecked="{Binding PreAction, Mode=TwoWay, Converter={x:Static c:EnumConverters.Equals}, ConverterParameter={x:Static vm:BeforeCreateBranchAction.StashAndReaply}}"/>
70+
IsChecked="{Binding PreAction, Mode=TwoWay, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static vm:BeforeCreateBranchAction.StashAndReaply}}"/>
6671
<RadioButton Content="{DynamicResource Text.CreateBranch.LocalChanges.Discard}"
6772
GroupName="LocalChanges"
6873
Margin="8,0,0,0"
69-
IsChecked="{Binding PreAction, Mode=TwoWay, Converter={x:Static c:EnumConverters.Equals}, ConverterParameter={x:Static vm:BeforeCreateBranchAction.Discard}}"/>
74+
IsChecked="{Binding PreAction, Mode=TwoWay, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static vm:BeforeCreateBranchAction.Discard}}"/>
7075
<RadioButton Content="{DynamicResource Text.CreateBranch.LocalChanges.DoNothing}"
7176
GroupName="LocalChanges"
7277
Margin="8,0,0,0"
73-
IsChecked="{Binding PreAction, Mode=TwoWay, Converter={x:Static c:EnumConverters.Equals}, ConverterParameter={x:Static vm:BeforeCreateBranchAction.DoNothing}}"/>
78+
IsChecked="{Binding PreAction, Mode=TwoWay, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static vm:BeforeCreateBranchAction.DoNothing}}"/>
7479
</StackPanel>
7580

7681
<CheckBox Grid.Row="3" Grid.Column="1"

0 commit comments

Comments
 (0)