Skip to content

Commit d6180f9

Browse files
committed
Change method to using multi-bool converter
which did not exist prior to this
1 parent 85b9bca commit d6180f9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Files.App/Converters/MultiBooleanConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public static Boolean OrAndConvert(bool a, bool b, bool c)
2222
public static Visibility OrConvertToVisibility(bool a, bool b)
2323
=> (a || b) ? Visibility.Visible : Visibility.Collapsed;
2424

25+
public static Visibility AndConvertToVisibility(bool a, bool b)
26+
=> (a && b) ? Visibility.Visible : Visibility.Collapsed;
27+
2528
public static Visibility NorConvertToVisibility(bool a, bool b)
2629
=> !(a || b) ? Visibility.Visible : Visibility.Collapsed;
2730

src/Files.App/ViewModels/HomeViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public sealed class HomeViewModel : ObservableObject, IDisposable
1111
// Dependency injections
1212

1313
private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService<IUserSettingsService>();
14-
private IAppearanceSettingsService AppearanceSettingsService { get; } = Ioc.Default.GetRequiredService<IAppearanceSettingsService>();
1514

1615
// Properties
1716

@@ -180,7 +179,6 @@ public void RemoveWidget<TWidget>() where TWidget : IWidgetViewModel
180179
private void ExecuteHomePageLoadedCommand(RoutedEventArgs? e)
181180
{
182181
ReloadWidgets();
183-
AppearanceSettingsService.ShowToolbar = false;
184182
}
185183

186184
// Disposer
@@ -191,7 +189,6 @@ public void Dispose()
191189
WidgetItems[i].Dispose();
192190

193191
WidgetItems.Clear();
194-
AppearanceSettingsService.ShowToolbar = true;
195192
}
196193
}
197194
}

src/Files.App/Views/MainPage.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
x:Class="Files.App.Views.MainPage"
44
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
55
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6+
xmlns:converters="using:Files.App.Converters"
67
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
78
xmlns:helpers="using:Files.App.Helpers"
89
xmlns:i="using:Microsoft.Xaml.Interactivity"
@@ -205,7 +206,7 @@
205206
ShowPreviewPaneButton="{x:Bind ViewModel.ShouldPreviewPaneBeDisplayed, Mode=OneWay}"
206207
ShowViewControlButton="{x:Bind ViewModel.ShouldViewControlBeDisplayed, Mode=OneWay}"
207208
TabIndex="2"
208-
Visibility="{x:Bind ViewModel.ShowToolbar, Mode=OneWay}" />
209+
Visibility="{x:Bind converters:MultiBooleanConverter.AndConvertToVisibility(SidebarAdaptiveViewModel.PaneHolder.ActivePaneOrColumn.InstanceViewModel.IsPageTypeNotHome, ViewModel.ShowToolbar), Mode=OneWay}" />
209210

210211
<!-- Page Content -->
211212
<ContentPresenter

0 commit comments

Comments
 (0)