| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 | using System;using System.Collections.Generic;using System.Windows;using System.Windows.Controls;using Comal.Classes;using InABox.Clients;using InABox.Configuration;using InABox.Core;namespace PRSDesktop{    /// <summary>    ///     Interaction logic for JobDock.xaml    /// </summary>    public partial class JobDock : UserControl, IDockPanel    {        private JobGrid _jobs;        public JobDock()        {            InitializeComponent();        }                public void Setup()        {            _jobs = new JobGrid();            _jobs.SetValue(Grid.RowProperty, 1);            _jobs.Margin = new Thickness(2);            _jobs.ColumnsTag = "JobDock";            _jobs.Refresh(true, false);            grid.Children.Add(_jobs);                          var statustable = new Client<JobStatus>().Query(                new Filter<JobStatus>(x => x.Active).IsEqualTo(true),                new Columns<JobStatus>(                    x => x.ID,                    x => x.Description                ),                new SortOrder<JobStatus>(x => x.Description)            );            JobStatus.ItemsSource = statustable.IntoDictionary<JobStatus, Guid>(                new Dictionary<Guid, string> { { Guid.Empty, "All Jobs" } },                x => x.ID,                x => x.Description            );            var settings = new UserConfiguration<JobScreenSettings>().Load();            _jobs.StatusID = settings.JobStatus;            _jobs.Refresh(true, false);        }        public void Refresh()        {            _jobs.Refresh(false, true);        }        private void JobStatus_SelectionChanged(object sender, SelectionChangedEventArgs e)        {            if (_jobs == null)                return;            _jobs.StatusID = (Guid)JobStatus.SelectedValue;        }    }}
 |