private void OnSeller(object sender, MouseButtonEventArgs e) { Grid grid = (Grid)sender; Color color = (Color)ColorConverter.ConvertFromString("#FFF58E78"); grid.Background = new SolidColorBrush(color); Label valueLabel = grid.Children.OfType <Label>().FirstOrDefault(); Cursor previousCursor = Mouse.OverrideCursor; Mouse.OverrideCursor = Cursors.Wait; try { Wystawca wystawca = WystawcaOperations.GetWystawcaById(int.Parse(valueLabel.Content.ToString())); SellerStatistics page = new SellerStatistics(wystawca); NavigationService.Navigate(page); } catch { } Mouse.OverrideCursor = previousCursor; }
private void CheckSeller(object sender, MouseButtonEventArgs e) { Grid grid = (Grid)sender; if (checkedGrid == grid) { Color c = (Color)ColorConverter.ConvertFromString("#FFF58E78"); checkedGrid.Background = new SolidColorBrush(c); checkedSeller = null; checkedGrid = null; NextButton.IsEnabled = false; } else if (checkedGrid != null) { Color c = (Color)ColorConverter.ConvertFromString("#FFF58E78"); checkedGrid.Background = new SolidColorBrush(c); checkedSeller = null; checkedGrid = null; Color color = (Color)ColorConverter.ConvertFromString("#FFFFC7BB"); grid.Background = new SolidColorBrush(color); checkedGrid = grid; Label valueLabel = grid.Children.OfType <Label>().FirstOrDefault(); checkedSeller = WystawcaOperations.GetWystawcaById(int.Parse(valueLabel.Content.ToString())); NextButton.IsEnabled = true; } else if (checkedGrid == null) { Color color = (Color)ColorConverter.ConvertFromString("#FFFFC7BB"); grid.Background = new SolidColorBrush(color); checkedGrid = grid; Label valueLabel = grid.Children.OfType <Label>().FirstOrDefault(); checkedSeller = WystawcaOperations.GetWystawcaById(int.Parse(valueLabel.Content.ToString())); NextButton.IsEnabled = true; } }