Skip to content

Commit 58309d0

Browse files
Lamparteryaira2
andauthored
Remove XAML behaviours command
Co-authored-by: Yair <[email protected]> Signed-off-by: Lamparter <[email protected]>
1 parent 40a125f commit 58309d0

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/Files.App/ViewModels/Properties/HashesViewModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public HashInfoItem SelectedItem
2626
public Dictionary<string, bool> ShowHashes { get; private set; }
2727

2828
public ICommand ToggleIsEnabledCommand { get; private set; }
29-
public ICommand HashInputTextChangedCommand { get; private set; }
3029
public ICommand CompareFileCommand { get; private set; }
3130

3231
private ListedItem _item;
@@ -39,10 +38,10 @@ public string HashInput
3938
get => _hashInput;
4039
set
4140
{
42-
OnHashInputTextChanged();
4341
SetProperty(ref _hashInput, value);
4442

4543
OnPropertyChanged(nameof(IsInfoBarOpen));
44+
OnHashInputTextChanged();
4645
}
4746
}
4847

@@ -95,7 +94,6 @@ public HashesViewModel(ListedItem item)
9594

9695
Hashes.Where(x => ShowHashes[x.Algorithm]).ForEach(x => ToggleIsEnabledCommand.Execute(x.Algorithm));
9796

98-
HashInputTextChangedCommand = new RelayCommand(OnHashInputTextChanged);
9997
CompareFileCommand = new RelayCommand(async () => await OnCompareFileAsync());
10098
}
10199

src/Files.App/Views/Properties/HashesPage.xaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
77
xmlns:datamodels="using:Files.App.Data.Models"
88
xmlns:helpers="using:Files.App.Helpers"
9-
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
109
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1110
xmlns:toolkitconverters="using:CommunityToolkit.WinUI.Converters"
1211
xmlns:vm="using:Files.App.ViewModels.Properties"
@@ -51,13 +50,7 @@
5150
<TextBox
5251
x:Name="HashInputTextBox"
5352
PlaceholderText="{helpers:ResourceString Name=EnterHashToCompare}"
54-
Text="{x:Bind HashesViewModel.HashInput, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
55-
<interactivity:Interaction.Behaviors>
56-
<interactivity:EventTriggerBehavior EventName="TextChanged">
57-
<interactivity:InvokeCommandAction Command="{x:Bind HashesViewModel.HashInputTextChangedCommand}" />
58-
</interactivity:EventTriggerBehavior>
59-
</interactivity:Interaction.Behaviors>
60-
</TextBox>
53+
Text="{x:Bind HashesViewModel.HashInput, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
6154
</Grid>
6255

6356
<!-- Compare File Button -->

0 commit comments

Comments
 (0)