Esempio n. 1
0
        private static void OnParentGridControlChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            RowSelector     rowSelector = ( RowSelector )sender;
            DataGridControl newGrid     = e.NewValue as DataGridControl;

            if (newGrid != null)
            {
                rowSelector.PrepareDefaultStyleKey(newGrid.GetView());
            }
        }
Esempio n. 2
0
        private static void OnRowSelectorStyleChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            RowSelector rowSelector = sender as RowSelector;

            //Here, since the property is an Attached propety, the type of sender can be anything, but in this particular case, I want
            //to filter out everything but RowSelector since this is my queue to set a local style on the RowSelector ( or clear the local
            //value).
            if (rowSelector == null)
            {
                return;
            }

            if (e.NewValue == null)
            {
                rowSelector.ClearValue(RowSelector.StyleProperty);
            }
            else
            {
                rowSelector.SetValue(RowSelector.StyleProperty, e.NewValue);
            }
        }