wenku10.Pages.Sharers.ScriptDetails.Delete C# (CSharp) Method

Delete() private method

private Delete ( object sender, RoutedEventArgs e ) : void
sender object
e Windows.UI.Xaml.RoutedEventArgs
return void
        private async void Delete( object sender, RoutedEventArgs e )
        {
            StringResources stx = new StringResources( "Message" );
            MessageDialog MsgBox = new MessageDialog( stx.Str( "ConfirmScriptRemove" ) );

            bool DoDelete = false;

            MsgBox.Commands.Add( new UICommand( stx.Str( "Yes" ), x => { DoDelete = true; } ) );
            MsgBox.Commands.Add( new UICommand( stx.Str( "No" ) ) );
            await Popups.ShowDialog( MsgBox );

            if ( DoDelete )
            {
                // Since we cannot close the Frame from here
                // We call for help
                MessageBus.SendUI( GetType(), AppKeys.SH_SCRIPT_REMOVE, new Tuple<string, HubScriptItem>( AccessToken, BindItem ) );
            }
        }