Skip to content

Commit ad1c44f

Browse files
committed
Hide set as default option on store versions
1 parent 3a3ac17 commit ad1c44f

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/Files/ViewModels/SettingsViewModels/ExperimentalViewModel.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System;
88
using System.Threading.Tasks;
99
using System.Windows.Input;
10+
using Windows.ApplicationModel;
1011
using Windows.Foundation.Collections;
1112
using Windows.Storage;
1213
using Windows.System;
@@ -27,6 +28,7 @@ public ExperimentalViewModel()
2728
{
2829
IsSetAsDefaultFileManager = DetectIsSetAsDefaultFileManager();
2930
IsSetAsOpenFileDialog = DetectIsSetAsOpenFileDialog();
31+
IsSideloadVersion = DetectIsSideloadVersion();
3032

3133
EditFileTagsCommand = new AsyncRelayCommand(LaunchFileTagsConfigFile);
3234
SetAsDefaultExplorerCommand = new AsyncRelayCommand(SetAsDefaultExplorer);
@@ -128,6 +130,15 @@ private bool DetectIsSetAsOpenFileDialog()
128130
return ApplicationData.Current.LocalSettings.Values.Get("IsSetAsOpenFileDialog", false);
129131
}
130132

133+
private bool DetectIsSideloadVersion()
134+
{
135+
if (Package.Current.Id.FamilyName == "49306atecsolution.FilesUWP_dwm5abbcs5pn0")
136+
{
137+
return false;
138+
}
139+
return true;
140+
}
141+
131142
private bool isSetAsDefaultFileManager;
132143

133144
public bool IsSetAsDefaultFileManager
@@ -143,5 +154,13 @@ public bool IsSetAsOpenFileDialog
143154
get => isSetAsOpenFileDialog;
144155
set => SetProperty(ref isSetAsOpenFileDialog, value);
145156
}
157+
158+
private bool isSideloadVersion;
159+
160+
public bool IsSideloadVersion
161+
{
162+
get => isSideloadVersion;
163+
set => SetProperty(ref isSideloadVersion, value);
164+
}
146165
}
147166
}

src/Files/Views/SettingsPages/Experimental.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xmlns:local="using:Files.UserControls.Settings"
1010
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1111
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
12-
xmlns:settingsviewmodels="using:Files.ViewModels.SettingsViewModels"
12+
xmlns:settingsviewmodels="using:Files.ViewModels.SettingsViewModels" xmlns:converters="using:Files.Converters"
1313
mc:Ignorable="d">
1414
<Page.Resources>
1515
<ResourceDictionary Source="/ResourceDictionaries/RightAlignedToggleSwitchStyle.xaml" />
@@ -96,7 +96,8 @@
9696
Title="{helpers:ResourceString Name=SettingsSetAsDefaultFileManager}"
9797
HorizontalAlignment="Stretch"
9898
Description="{helpers:ResourceString Name=SettingsSetAsDefaultFileManagerDescription}"
99-
IsExpanded="True">
99+
IsExpanded="True"
100+
x:Load="{Binding converters:MultiBooleanConverter.OrConvertToVisibility(IsSetAsDefaultFileManager, IsSideloadVersion), Mode=OneWay}">
100101
<local:SettingsBlockControl.Icon>
101102
<FontIcon Glyph="&#xEC50;" />
102103
</local:SettingsBlockControl.Icon>

0 commit comments

Comments
 (0)