'アカウント事態を削除
Private Async Sub AccuntRemove_Click(sender As Object, e As RoutedEventArgs) Handles AccuntRemove.Click
'メッセージボックス
Dim msgdg As New MessageDialog("Do you want to delete your account?", Me.pageTitle.Text)
Dim uicOK As New UICommand("OK", New UICommandInvokedHandler(AddressOf CommandInvokedHandler))
Dim uicCancel As New UICommand("Cancel", New UICommandInvokedHandler(AddressOf CommandInvokedHandler))
msgdg.Commands.Add(uicOK)
msgdg.Commands.Add(uicCancel)
Await msgdg.ShowAsync()
End Sub
Private Async Function CommandInvokedHandler(command As Windows.UI.Popups.IUICommand) As Task
Select Case command.Label
Case "OK"
'[OK]が押された処理をここに記述
Dim UserName As String = fileName.Replace(".xml", "")
Dim file As StorageFile
Dim storageFolder As StorageFolder = Windows.Storage.ApplicationData.Current.LocalFolder 'KnownFolders.DocumentsLibrary
'有れば置き換える
file = Await storageFolder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting)
Await file.DeleteAsync()
Dim msgdg As New MessageDialog("Has been deleted", Me.pageTitle.Text)
Await msgdg.ShowAsync()
'メインページに戻る
Me.Frame.GoBack()
Case "Cancel"
'[Cancel]が押された処理をここに記述
Dim msgdg As New MessageDialog("Canceled", Me.pageTitle.Text)
Await msgdg.ShowAsync()
End Select
End Function
|