fix: IsEnabled handler not triggered when GPGFormat changed

This commit is contained in:
Gadfly 2024-05-31 11:39:15 +08:00
parent 80dfa059ce
commit 198cf04c09
2 changed files with 6 additions and 3 deletions

View file

@ -438,7 +438,7 @@
Height="28" Height="28"
CornerRadius="3" CornerRadius="3"
Text="{Binding #me.GPGExecutableFile, Mode=TwoWay}" Text="{Binding #me.GPGExecutableFile, Mode=TwoWay}"
IsEnabled="{Binding #me.GPGFormat, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static m:GPGFormat.OPENPGP}}"> IsEnabled="{Binding #me.GPGFormat, Mode=TwoWay, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static m:GPGFormat.OPENPGP}}">
<TextBox.InnerRightContent> <TextBox.InnerRightContent>
<Button Classes="icon_button" Width="30" Height="30" Click="SelectGPGExecutable"> <Button Classes="icon_button" Width="30" Height="30" Click="SelectGPGExecutable">
<Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>

View file

@ -66,10 +66,13 @@ namespace SourceGit.Views
set; set;
} }
public static readonly StyledProperty<Models.GPGFormat> GPGFormatProperty =
AvaloniaProperty.Register<Preference, Models.GPGFormat>(nameof(GPGFormat));
public Models.GPGFormat GPGFormat public Models.GPGFormat GPGFormat
{ {
get; get => GetValue(GPGFormatProperty);
set; set => SetValue(GPGFormatProperty, value);
} }
public static readonly StyledProperty<string> GPGExecutableFileProperty = public static readonly StyledProperty<string> GPGExecutableFileProperty =