using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using PracticaDemoexam.Model; using PracticaDemoexam.Model.ItemModels; using PracticaDemoexam.Windows; namespace PracticaDemoexam.Windows { /// /// Логика взаимодействия для PriorityChanger.xaml /// public partial class PriorityChanger : Window { public List SelectedAgents; private void SetPriority() { int ret = 0; foreach (AgentModel am in SelectedAgents) { if(am.Agent.Priority > ret) { ret = am.Agent.Priority; } } tbPrior.Text = ret.ToString(); } public PriorityChanger(List ls) { InitializeComponent(); SelectedAgents = ls; this.Loaded += PriorityChanger_Loaded; } private void PriorityChanger_Loaded(object sender, RoutedEventArgs e) { SetPriority(); } public Action, int> Button_click; private void Button_Click(object sender, RoutedEventArgs e) { Button_click.Invoke(SelectedAgents, Convert.ToInt32(tbPrior.Text)); } } }