Пример #1
0
        public static void OnIsEnabledPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            var checkBox = dependencyObject as CheckBox;

            if (checkBox != null)
            {
                var behavior = new MyBehavior(checkBox);
                checkBox.Dispatcher.BeginInvoke(new Action
                                                    (() =>
                {
                    var grid = checkBox.ParentOfType <RadGridView>();
                    if (grid != null)
                    {
                        grid.SelectionChanged += behavior.grid_SelectionChanged;
                    }
                }));
            }
        }
Пример #2
0
		public static void OnIsEnabledPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
		{
			var checkBox = dependencyObject as CheckBox;

			if (checkBox != null)
			{
				var behavior = new MyBehavior(checkBox);
				checkBox.Dispatcher.BeginInvoke(new Action
				(() =>
				{
					var grid = checkBox.ParentOfType<RadGridView>();
					if (grid != null)
					{
						grid.SelectionChanged += behavior.grid_SelectionChanged;
					}
				}));				
			}
		}