public static ProductsViewer GetInstance(Employee empl) { if (State == null) { State = new ProductsViewer(empl); } if (State.employee.Id != empl.Id) { State = new ProductsViewer(empl); } ProductsOnStorage.Clear(); if (State.GetNewContext.ifExecute()) { State.GetNewContext.Execute(); } return(State); }
private void ShowAll_Click(object sender, RoutedEventArgs e) { ProductsObserverWorkSpace.Content = ProductsViewer.GetInstance(employee).Content; }
ProductsObserver(Employee employee) { this.employee = employee; InitializeComponent(); ProductsObserverWorkSpace.Content = ProductsViewer.GetInstance(employee).Content; }