public object Convert(object value, Type targetType, object parameter, string language) { if (value != null) { StatusOfSolution status = (StatusOfSolution)Enum.Parse(typeof(StatusOfSolution), value.ToString()); Color color; SolidColorBrush returnBrush; switch (status) { case StatusOfSolution.NotSet: returnBrush = new SolidColorBrush(Windows.UI.Colors.Orange); color = Colors.Orange; break; case StatusOfSolution.Production: returnBrush = new SolidColorBrush(Windows.UI.Colors.Blue); color = Colors.Blue; break; case StatusOfSolution.Working: returnBrush = new SolidColorBrush(Windows.UI.Colors.Green); color = Colors.Green; break; case StatusOfSolution.InDevelop: returnBrush = new SolidColorBrush(Windows.UI.Colors.Black); color = Colors.Black; break; case StatusOfSolution.Brokered: returnBrush = new SolidColorBrush(Windows.UI.Colors.Red); color = Colors.Red; break; case StatusOfSolution.Abandoned: returnBrush = new SolidColorBrush(Windows.UI.Colors.Purple); color = Colors.Purple; break; default: returnBrush = new SolidColorBrush(Windows.UI.Colors.Transparent); color = Colors.Transparent; break; } return(color); } else { return(Colors.Transparent); } }
private void ResultStatusFilter(StatusOfSolution statusToFilter) { var list = (from s in solutions where s.stauts == statusToFilter select s).ToList(); if (list == null || list.Count <= 0) { return; } filteredSolutions.Clear(); foreach (var item in list) { filteredSolutions.Add(item); } solutionsGrid.ItemsSource = filteredSolutions; }
private void HyperlinkButton_Click(object sender, RoutedEventArgs e) { HyperlinkButton link = sender as HyperlinkButton; string searchPatternRequested = link.CommandParameter.ToString().Split('-').LastOrDefault(); if (!string.IsNullOrEmpty(searchPatternRequested)) { if (searchPatternRequested == "ClearFilter") { filteredSolutions = solutions; solutionsGrid.ItemsSource = filteredSolutions; } else { StatusOfSolution statusToFilter = (StatusOfSolution)Enum.Parse(typeof(StatusOfSolution), searchPatternRequested); ResultStatusFilter(statusToFilter); } } }