Example #1
0
        public void checkedthemebox(object sender, EventArgs e)
        {
            CheckBox  checkBox          = sender as CheckBox;
            LayerItem _layeritem        = layeritems.FirstOrDefault(x => x.checkbox == checkBox);
            LayerCheckBoxClickArgs args = new LayerCheckBoxClickArgs();

            args.Item = _layeritem;
            if (OnLayerCheckBoxClick != null)
            {
                OnLayerCheckBoxClick(this, args);
            }

            foreach (LayerItem lt in _layeritem.childs)
            {
                lt.checkbox.IsChecked = true;
            }
        }
Example #2
0
        public void uncheckedlayerbox(object sender, EventArgs e)
        {
            CheckBox  checkBox          = (CheckBox)(sender);
            LayerItem _layeritem        = layeritems.FirstOrDefault(x => x.checkbox == checkBox);
            LayerCheckBoxClickArgs args = new LayerCheckBoxClickArgs();

            args.Item = _layeritem;
            if (OffLayerCheckBoxClick != null)
            {
                OffLayerCheckBoxClick(this, args);
            }


            if (_layeritem.parent.childs.FirstOrDefault(x => x.checkbox.IsChecked == true) == null)
            {
                _layeritem.parent.checkbox.IsChecked = false;
            }
        }
Example #3
0
        public void checkedlayerbox(object sender, EventArgs e)
        {
            CheckBox  checkBox          = sender as CheckBox;
            LayerItem _layeritem        = layeritems.FirstOrDefault(x => x.checkbox == checkBox);
            LayerCheckBoxClickArgs args = new LayerCheckBoxClickArgs();

            args.Item = _layeritem;
            if (OnLayerCheckBoxClick != null)
            {
                OnLayerCheckBoxClick(this, args);
            }

            _layeritem.parent.checkbox.Checked  -= checkedthemebox;
            _layeritem.parent.checkbox.IsChecked = true;
            args.Item = layeritems.FirstOrDefault(x => x.checkbox == _layeritem.parent.checkbox);
            if (OnLayerCheckBoxClick != null)
            {
                OnLayerCheckBoxClick(this, args);
            }
            _layeritem.parent.checkbox.Checked += checkedthemebox;
        }