public static MessageBoxResult ShowDialog(string Title, string Prompt, out string Input, MessageBoxButton Buttons = MessageBoxButton.OK) { InputBoxView v = new InputBoxView(); (v.DataContext as InputBoxViewModel).SetBox(Title, Prompt, Buttons); v.ShowDialog(); Input = (v.DataContext as InputBoxViewModel).Input; return((v.DataContext as InputBoxViewModel).Result); }
private void ReplySend(object obj) { string MessageText = string.Empty; MessageBoxResult res = InputBoxView.ShowDialog(string.Format("New message to {0}", Gamertag), "Message:", out MessageText, MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { XboxConnection.SendMessage(Gamertag, MessageText); } }
private void MessageSend(object obj) { string MessageText = string.Empty; MessageBoxResult res = InputBoxView.ShowDialog(string.Format("New message to {0}", Friends.ElementAt(SelectedFriendIndex).Gamertag), "Message:", out MessageText, MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { XboxConnection.SendMessage(Friends.ElementAt(SelectedFriendIndex).Gamertag, MessageText); } }
private void FriendAdd(object obj) { string Gamertag = string.Empty; MessageBoxResult res = InputBoxView.ShowDialog("Send Friend Request", "Gamertag to Add:", out Gamertag, MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { XboxConnection.AddFriend(XboxConnection.XuidFromGamertag(Gamertag)); } }