Skip to content

Commit a4775f4

Browse files
committed
Squash previous commits (to revert)
1 parent 4870c4e commit a4775f4

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public HashInfoItem SelectedItem
2424

2525
public Dictionary<string, bool> ShowHashes { get; private set; }
2626

27+
public bool InfoBarVisible { get; set; }
28+
2729
public ICommand ToggleIsEnabledCommand { get; private set; }
2830

2931
private ListedItem _item;
@@ -33,6 +35,7 @@ public HashInfoItem SelectedItem
3335
public HashesViewModel(ListedItem item)
3436
{
3537
ToggleIsEnabledCommand = new RelayCommand<string>(ToggleIsEnabled);
38+
InfoBarVisible = false;
3639

3740
_item = item;
3841
_cancellationTokenSource = new();

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@
7575
Grid.Row="1"
7676
Grid.Column="0"
7777
Margin="12,75,12,12"
78+
x:Load="{x:Bind HashesViewModel.InfoBarVisible, Mode=OneWay}"
7879
IsClosable="False"
79-
IsOpen="False"
80+
IsOpen="True"
8081
Message="No hashes match the provided hash."
8182
Severity="Informational" />
8283

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ private void HashInputTextBox_TextChanged(object sender, TextChangedEventArgs e)
6363

6464
if (string.IsNullOrEmpty(matchingAlgorithm))
6565
{
66+
HashesViewModel.InfoBarVisible = true;
6667
HashMatchInfoBar.Severity = InfoBarSeverity.Error;
6768
HashMatchInfoBar.Title = Strings.HashesDoNotMatch.GetLocalizedResource();
68-
HashMatchInfoBar.IsOpen = true;
6969
return;
7070
}
7171
else
7272
{
73+
HashesViewModel.InfoBarVisible = true;
7374
HashMatchInfoBar.Severity = InfoBarSeverity.Success;
7475
HashMatchInfoBar.Title = string.Format(Strings.HashesMatch.GetLocalizedResource(), matchingAlgorithm);
75-
HashMatchInfoBar.IsOpen = true;
7676
return;
7777
}
7878
}
@@ -82,6 +82,8 @@ private async void CompareFileButton_Click(object sender, RoutedEventArgs e)
8282
{
8383
var result = await HashesViewModel.CompareFileAsync();
8484

85+
HashesViewModel.InfoBarVisible = true;
86+
8587
if (result)
8688
{
8789
HashMatchInfoBar.Severity = InfoBarSeverity.Success; // Check mark
@@ -92,8 +94,6 @@ private async void CompareFileButton_Click(object sender, RoutedEventArgs e)
9294
HashMatchInfoBar.Severity = InfoBarSeverity.Error; // Cross mark
9395
HashMatchInfoBar.Title = "no";
9496
}
95-
96-
HashMatchInfoBar.IsOpen = true;
9797
}
9898

9999
private void MenuFlyout_Closing(FlyoutBase sender, FlyoutBaseClosingEventArgs e)

0 commit comments

Comments
 (0)