Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        private static void OnIsShownTagsChanged(FilterControl control, bool isShown)
        {
            if (isShown)
            {
                control.TagsPanelVisibility        = Visibility.Visible;
                control.ContentPresenterVisibility = Visibility.Hidden;
            }
            else
            {
                control.TagsPanelVisibility        = Visibility.Hidden;
                control.ContentPresenterVisibility = Visibility.Visible;
            }

            control.IsShownTagsChanged.NullSafeInvoke(isShown);
        }
Exemplo n.º 3
0
        private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            FilterControl control = (FilterControl)d;

            if (e.Property == InnerContentProperty)
            {
                OnInnerContentChanged(control, (UIElement)e.NewValue);
            }
            else if (e.Property == IsShownTagsProperty)
            {
                OnIsShownTagsChanged(control, (bool)e.NewValue);
            }
            else if (e.Property == AvaliblePropertiesProperty)
            {
                OnAvaliblePropertiesChanged(control, (IEnumerable <Enum>)e.NewValue);
            }
            else if (e.Property == AvalibleTagsProperty)
            {
                OnAvalibleTagsChanged(control, (IEnumerable <UserTag>)e.NewValue);
            }
            else if (e.Property == FilterTextProperty)
            {
                OnFilterTextChanged(control, (string)e.NewValue);
            }
            else if (e.Property == InternalFilterTextProperty)
            {
                OnInternalFilterTextChanged(control, (string)e.NewValue);
            }
            else if (e.Property == FilterControlHeightProperty || e.Property == InternalFilterControlHeightProperty)
            {
                OnFilterControlHeightChanged(control, (double)e.NewValue);
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Exemplo n.º 4
0
 private static void OnFilterTextChanged(FilterControl control, string filter)
 {
     control.FilterChanged.NullSafeInvoke(filter);
 }
Exemplo n.º 5
0
 private static void OnInnerContentChanged(FilterControl control, UIElement newValue)
 {
     control._innerContentGrid.Children.Clear();
     control._innerContentGrid.Children.Add(newValue);
     control.UpdateToggleButtonVisibility();
 }