private static void OnAvaliblePropertiesChanged(FilterControl control, IEnumerable <Enum> newValue) { ConcurrentDictionary <Enum, CheckBox> states = control._propertiesState; UIElementCollection propertiesPanel = control._propertiesPanel.Children; states.Clear(); propertiesPanel.Clear(); foreach (Enum value in newValue) { CheckBox checkBox = new CheckBox { Content = value, IsChecked = null, Margin = new Thickness(3), Tag = value, IsThreeState = true, }; states.TryAdd(value, checkBox); checkBox.Checked += control.OnPropertyCheckedChanged; propertiesPanel.Add(checkBox); } control.UpdateToggleButtonVisibility(); }
private static void OnAvalibleTagsChanged(FilterControl control, IEnumerable <UserTag> newValue) { ConcurrentDictionary <UserTag, CheckBox> states = control._tagsState; UIElementCollection tagsPanel = control._tagsPanel.Children; states.Clear(); tagsPanel.Clear(); foreach (UserTag userTag in newValue) { SolidColorBrush foreground = new SolidColorBrush(userTag.Foreground); SolidColorBrush background = new SolidColorBrush(userTag.Background); foreground.Freeze(); background.Freeze(); CheckBox checkBox = new CheckBox { Content = userTag.Name, Background = background, IsChecked = null, Margin = new Thickness(3), Tag = userTag, IsThreeState = true, }; states.TryAdd(userTag, checkBox); checkBox.Checked += control.OnTagCheckedChanged; tagsPanel.Add(checkBox); } control.UpdateToggleButtonVisibility(); }
private static void OnInnerContentChanged(FilterControl control, UIElement newValue) { control._innerContentGrid.Children.Clear(); control._innerContentGrid.Children.Add(newValue); control.UpdateToggleButtonVisibility(); }