Example #1
0
        private void Cbtn_Unchecked(object sender, RoutedEventArgs e)
        {
            TZCheckBox cBtn  = sender as TZCheckBox;
            string     value = cBtn.Value + ",";

            _categoriesID = _categoriesID.Replace(value, "");
        }
Example #2
0
        private void CbtnAll_Unchecked(object sender, RoutedEventArgs e)
        {
            TZCheckBox cBtn = sender as TZCheckBox;

            foreach (TZCheckBox item in wpZL.Children)
            {
                item.IsChecked = false;
            }

            _categoriesID = null;
        }
Example #3
0
        //种类
        private void categories_Load()
        {
            WebAPIHelper dt = new WebAPIHelper();

            dt.GetDataCompleted += (s, args) =>
            {
                rbiLoad.IsBusy = true;

                List <MapElementCategorie> _dataList = args.DataResult as List <MapElementCategorie>;

                TZCheckBox cbtnAll = new TZCheckBox();
                cbtnAll.Value               = -1;
                cbtnAll.Content             = "全部";
                cbtnAll.Foreground          = new SolidColorBrush(Colors.White);
                cbtnAll.Width               = 120;
                cbtnAll.Margin              = new Thickness(10, 6, 0, 0);
                cbtnAll.HorizontalAlignment = HorizontalAlignment.Left;
                cbtnAll.IsChecked           = true;
                cbtnAll.Checked            += CbtnAll_Checked;
                cbtnAll.Unchecked          += CbtnAll_Unchecked;

                wpZL.Children.Add(cbtnAll);

                foreach (var item in _dataList)
                {
                    TZCheckBox cbtn = new TZCheckBox();
                    cbtn.Value               = item.ID;
                    cbtn.Content             = item.Name;
                    cbtn.Foreground          = new SolidColorBrush(Colors.White);
                    cbtn.Width               = 120;
                    cbtn.Margin              = new Thickness(10, 6, 0, 0);
                    cbtn.HorizontalAlignment = HorizontalAlignment.Left;
                    cbtn.Checked            += Cbtn_Checked;
                    cbtn.Unchecked          += Cbtn_Unchecked;
                    cbtn.IsChecked           = true;

                    wpZL.Children.Add(cbtn);
                }

                rbiLoad.IsBusy = false;
            };

            string url = "api/MapElementCategorie/Query";

            dt.GetDataAsync <List <MapElementCategorie> >(url);
        }
Example #4
0
        private void Cbtn_Checked(object sender, RoutedEventArgs e)
        {
            TZCheckBox cBtn = sender as TZCheckBox;

            _categoriesID += cBtn.Value + ",";
        }