private async void PopupSettings( object P )
{
if( P.GetType() == typeof( bool ) )
{
StringResources sts = new StringResources( "Settings" );
if ( !Properties.ENABLE_ONEDRIVE )
{
StringResources stx = new StringResources( "InitQuestions" );
StringResources stm = new StringResources( "Message" );
MessageDialog Msg = new MessageDialog( stx.Text( "EnableOneDrive" ), "OneDrive" );
Msg.Commands.Add(
new UICommand( stm.Str( "Yes" ), ( x ) => Properties.ENABLE_ONEDRIVE = true )
);
Msg.Commands.Add(
new UICommand( stm.Str( "No" ), ( x ) => Properties.ENABLE_ONEDRIVE = false )
);
await Popups.ShowDialog( Msg );
if ( Properties.ENABLE_ONEDRIVE )
{
if ( global::wenku8.Storage.OneDriveSync.Instance == null )
{
global::wenku8.Storage.OneDriveSync.Instance = new global::wenku8.Storage.OneDriveSync();
}
await global::wenku8.Storage.OneDriveSync.Instance.Authenticate();
}
OneDriveButton.Desc = sts.Text( "Enabled" );
}
else
{
Properties.ENABLE_ONEDRIVE = false;
await global::wenku8.Storage.OneDriveSync.Instance.UnAuthenticate();
OneDriveButton.Desc = sts.Text( "Disabled" );
}
return;
}
PopupFrame.Navigate( ( Type ) P );
PopupPage.State = ControlState.Reovia;
}