传值流程

来源:互联网 发布:window python编译器 编辑:程序博客网 时间:2024/06/04 17:44
 


调用控件:
  <usercontrols:NumberBox 
GroupVos ="{Binding Path=GroupVos}"  
NumText ="{Binding Path=Number,Mode=TwoWay}" 
NumTextAddClick="NumberBox_NumTextAddClick" 
NumTextSubClick="NumberBox_NumTextSubClick" 
Tag ="{Binding Path=Id}" Margin="5,0"/>




 public static readonly 
DependencyProperty GroupVosProperty = DependencyProperty.Register("GroupVos", typeof(ObservableCollection<Group>), typeof(NumberBox));


 public ObservableCollection<Group> GroupVos
        {
            get
            {
                return (ObservableCollection<Group>)GetValue(GroupVosProperty);
            }
            set
            {


                SetValue(GroupVosProperty, value);
            }
        }


public void choose_Click(object sender, RoutedEventArgs e) {
           
            ChooseButton cs = new ChooseButton(Window.GetWindow(this), GroupVos);


            bool? b = cs.ShowDialog();
            if (b == true)
            {


            }
            
            if (NumText < 1000)
            {
                NumText++;
                NumTextAddClick(this, EventArgs.Empty);
            }


        }


点击事件--> 将groupvos传递到后台  --> readonly  --> return   


 
原创粉丝点击