mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-24 19:02:39 +08:00
code_review: PR #208
* make sure there's only one radio button that will change the binding value * remove unused code
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Converters
|
||||
@@ -16,21 +13,5 @@ namespace SourceGit.Converters
|
||||
|
||||
public static readonly FuncValueConverter<bool, FontWeight> BoldIfTrue =
|
||||
new FuncValueConverter<bool, FontWeight>(x => x ? FontWeight.Bold : FontWeight.Regular);
|
||||
|
||||
public class InverseConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return !(bool)value;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return !(bool)value;
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly InverseConverter Inverse = new InverseConverter();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
Classes="icon_button"
|
||||
Width="48"
|
||||
GroupName="SearchGroup"
|
||||
IsChecked="{Binding IsSearching, Mode=TwoWay, Converter={x:Static c:BoolConverters.Inverse}}">
|
||||
IsChecked="{Binding !IsSearching, Mode=OneWay}">
|
||||
<Path Width="14" Height="14" Stretch="Fill" HorizontalAlignment="Center" Data="{StaticResource Icons.Home}"/>
|
||||
</RadioButton>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user