public async void Remove(IRCServerData ServerData) { MessageDialog PromptDialog = new MessageDialog(ServerData.Name + " will be deleted from the base.", "Delete server?"); bool?result = null; PromptDialog.Commands.Add(new UICommand( "Yes", new UICommandInvokedHandler((cmd) => result = true))); PromptDialog.Commands.Add(new UICommand( "Cancel", new UICommandInvokedHandler((cmd) => result = false))); // Set the command that will be invoked by default PromptDialog.DefaultCommandIndex = 0; // Set the command to be invoked when escape is pressed PromptDialog.CancelCommandIndex = 1; // Show the message dialog await PromptDialog.ShowAsync(); if (result == true) { Servers.Remove(ServerData); } }
// Accessors public void Add(IRCServerData ServerData) { Servers.Add(ServerData); }