Skip to content

Commit ff1bcac

Browse files
committed
Hide info bar when no hash is provided
1 parent 7260e7a commit ff1bcac

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
1+
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
22
<vm:BasePropertiesPage
33
x:Class="Files.App.Views.Properties.HashesPage"
44
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
@@ -72,13 +72,12 @@
7272

7373
<InfoBar
7474
x:Name="HashMatchInfoBar"
75-
Title="Title"
7675
Grid.Row="1"
7776
Grid.Column="0"
7877
Margin="12,75,12,12"
7978
IsClosable="False"
80-
IsOpen="True"
81-
Message="Message"
79+
IsOpen="False"
80+
Message="No hashes match the provided hash."
8281
Severity="Informational" />
8382

8483
<Grid

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private void CompareHashes()
5757

5858
if (string.IsNullOrEmpty(hashToCompare))
5959
{
60-
HashMatchInfoBar.Visibility = Visibility.Collapsed;
60+
HashMatchInfoBar.IsOpen = false;
6161
return;
6262
}
6363

@@ -67,14 +67,14 @@ private void CompareHashes()
6767
{
6868
HashMatchInfoBar.Severity = InfoBarSeverity.Success; // Set success
6969
HashMatchInfoBar.Title = string.Format(Strings.HashesMatch.GetLocalizedResource(), hashInfo.Algorithm);
70-
HashMatchInfoBar.Visibility = Visibility.Visible;
70+
HashMatchInfoBar.IsOpen = true;
7171
return;
7272
}
7373
}
7474

7575
HashMatchInfoBar.Severity = InfoBarSeverity.Error; // Set error
7676
HashMatchInfoBar.Title = Strings.HashesDoNotMatch.GetLocalizedResource();
77-
HashMatchInfoBar.Visibility = Visibility.Visible;
77+
HashMatchInfoBar.IsOpen = true;
7878
}
7979

8080
private async void CompareFileButton_Click(object sender, RoutedEventArgs e)
@@ -101,7 +101,7 @@ private async void CompareFileButton_Click(object sender, RoutedEventArgs e)
101101
HashMatchInfoBar.Title = Strings.HashesMatch.GetLocalizedResource();
102102
}
103103

104-
HashMatchInfoBar.Visibility = Visibility.Visible;
104+
HashMatchInfoBar.IsOpen = true;
105105
}
106106
}
107107

0 commit comments

Comments
 (0)