SharedModeSettings.ShouldAvoidLocalStorage Property

Definition

Gets a Boolean value indicating that your app should not store files on the local hard drive.

public:
 static property bool ShouldAvoidLocalStorage { bool get(); };
static bool ShouldAvoidLocalStorage();
public static bool ShouldAvoidLocalStorage { get; }
var boolean = SharedModeSettings.shouldAvoidLocalStorage;
Public Shared ReadOnly Property ShouldAvoidLocalStorage As Boolean

Property Value

Boolean

bool

A Boolean value indicating that apps should not store files on the local hard drive. Instead, files should be saved to cloud storage.

Windows requirements

Device family
Windows 10 Creators Update (introduced in 10.0.15063.0)
API contract
Windows.System.Profile.ProfileSharedModeContract (introduced in v2.0)

Examples

<StackPanel>
  <ListView x:Name="ThisPC" Header="This PC" .../>
  <ListView x:Name="OneDrive" Header="OneDrive" .../>
</StackPanel>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
    if (Windows.System.Profile.SharedModeSettings.ShouldAvoidLocalStorage)
    {
        ThisPC.Visibility = Visibility.Collapsed;
    }
}

Remarks

If true, then your app should not show local storage locations in its UI.

Returns true when the RestrictLocalStorage policy is set.

A true value means the PC is running in a scenario where apps should hide all entry and save points to the local disk. Windows File Explorer is disabled so customers won’t be able to navigate to any local storage (except downloads, removable drives, and mapped network drives) to access those files.

Applies to