private void CreateNewButton_Click(object sender, RoutedEventArgs e) { checkTime(); AddAgent addAgent = new AddAgent(this); addAgent.ShowDialog(); }
private void btnAddAgent_Click(object sender, RoutedEventArgs e) { AgentViewModels agentModel = new AgentViewModels(); AddAgent a = new AddAgent(agentModel); //создаем окно a.Title = "Добавить Агента"; a.Owner = this;//устанавливаем собственника окна var result = a.ShowDialog(); if (result == true) { agentService.CreateAgent(agentModel); ResetCollection("AgentsViewModel"); int Index = agentsModel.Count - 1; dGridAgent.SelectedIndex = Index; a.Close(); } }
private void AddAgentWindow(object sender, RoutedEventArgs e) { AddAgent addAgent = new AddAgent(); addAgent.ShowDialog(); }