private void MenuItem_Create_Click(object sender, RoutedEventArgs e) { var server = NewsServerConnectionData.NewDefaultConnection; var serverEdit = new ServerEditWindow(); serverEdit.Owner = Window.GetWindow(this); serverEdit.DataContext = server; bool?res = serverEdit.ShowDialog(); if (res.Value && serverEdit.MessageView.Result == WPFMessageViewResult.Ok) { NewsServerCollection.Add(server); } }
public void AddUsenetServer() { var server = NewsServerConnectionData.NewDefaultConnection; var serverEdit = new ServerEditWindow(); serverEdit.Owner = Window.GetWindow(this); serverEdit.DataContext = server; bool?res = serverEdit.ShowDialog(); if (res.Value && serverEdit.MessageView.Result == WPFMessageViewResult.Ok) { _model.NewsServerCollection.Add(server); } }
private void EditServer(int idx, NewsServer server) { var serverCopy = new NewsServerConnectionData(server.ServerConnection); var serverEdit = new ServerEditWindow(); serverEdit.Owner = Window.GetWindow(this); serverEdit.DataContext = serverCopy; bool?res = serverEdit.ShowDialog(); if (res.Value && serverEdit.MessageView.Result == WPFMessageViewResult.Ok) { NewsServerCollection.Change(idx, serverCopy); } }