Пример #1
0
        private static void CheckBox_DataUnChecked(object sender, RoutedEventArgs e)
        {
            DataFieldCheckBox dataFieldCheckBox = sender as DataFieldCheckBox;
            var path = ControlExt.GetDataSourcePath(dataFieldCheckBox);

            if (path != null)
            {
                var tmp = ControlExt.GetDataSource(dataFieldCheckBox);
                if (tmp is bool)
                {
                    ControlExt.SetDataSource(dataFieldCheckBox, false);
                    EnforceDoChange(dataFieldCheckBox, path, 0);
                }
            }
        }
Пример #2
0
        private static void CheckBox_DataChecked(object sender, RoutedEventArgs e)
        {
            var dataFieldCheckBox = sender as DataFieldCheckBox;
            var path = ControlExt.GetDataSourcePath(dataFieldCheckBox);

            if (!string.IsNullOrEmpty(path))
            {
                var tmp = ControlExt.GetDataSource(dataFieldCheckBox);
                if (tmp == null)
                {
                    return;
                }
                var propValue = ComponentUtils.GetPropValue(tmp, path);
                if (dataFieldCheckBox != null)
                {
                    dataFieldCheckBox.IsChecked = true;
                    ControlExt.SetDataSource(dataFieldCheckBox, true);
                    EnforceDoChange(dataFieldCheckBox, path, 1);
                }
            }
        }