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 { /// /// Interaction logic for JobDock.xaml /// public partial class JobDock : UserControl, IDockPanel { private ProjectsGrid _projects; public JobDock() { InitializeComponent(); } public void Setup() { _projects = new ProjectsGrid(); _projects.SetValue(Grid.RowProperty, 1); _projects.ColumnsTag = "JobDock"; _projects.Refresh(true, false); grid.Children.Add(_projects); var statustable = new Client().Query( new Filter(x => x.Active).IsEqualTo(true), Columns.None().Add( x => x.ID, x => x.Description ), new SortOrder(x => x.Description) ); JobStatus.ItemsSource = statustable.IntoDictionary( new Dictionary { { Guid.Empty, "All Jobs" } }, x => x.ID, x => x.Description ); var settings = new UserConfiguration().Load(); _projects.StatusID = settings.JobStatus; _projects.Refresh(true, false); } public void Refresh() { _projects.Refresh(false, true); } private void JobStatus_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_projects == null) return; _projects.StatusID = (Guid)JobStatus.SelectedValue; _projects.Refresh(false, true); } } }