//如果鼠标双击 private void BaseCheckControl_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) { //获取Check的空姐 ColorCheckControl _colorCheckControl = sender as ColorCheckControl; //让这个Check的按钮动画,恢复到正常的大小 AnimationTool.PlayButtonAnimation(false, _colorCheckControl.PressAnimationSize, _colorCheckControl.BaseButtonScaleTransform);//获取"抬起动画",并播放动画 //触发事件 this.OnMouseDoubleClickCheck(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ColorCheckUserControl = ((EasyBugManager.ColorCheckControl)(target)); return; case 2: this.BaseButton = ((System.Windows.Controls.Button)(target)); #line 18 "..\..\..\..\..\Xaml\Control\Base\ColorCheckControl.xaml" this.BaseButton.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Button_OnPreviewMouseDown); #line default #line hidden #line 19 "..\..\..\..\..\Xaml\Control\Base\ColorCheckControl.xaml" this.BaseButton.PreviewMouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Button_OnPreviewMouseUp); #line default #line hidden #line 20 "..\..\..\..\..\Xaml\Control\Base\ColorCheckControl.xaml" this.BaseButton.MouseEnter += new System.Windows.Input.MouseEventHandler(this.BaseButton_OnMouseEnter); #line default #line hidden #line 21 "..\..\..\..\..\Xaml\Control\Base\ColorCheckControl.xaml" this.BaseButton.MouseLeave += new System.Windows.Input.MouseEventHandler(this.BaseButton_OnMouseLeave); #line default #line hidden #line 22 "..\..\..\..\..\Xaml\Control\Base\ColorCheckControl.xaml" this.BaseButton.Click += new System.Windows.RoutedEventHandler(this.Button_OnClick); #line default #line hidden return; case 3: this.ButtonImageBorder = ((System.Windows.Controls.Border)(target)); return; case 4: this.BaseButtonScaleTransform = ((System.Windows.Media.ScaleTransform)(target)); return; } this._contentLoaded = true; }
/// <summary> /// 依赖项属性发生改变时,触发的事件: /// 当IsCanClickProperty依赖项属性,的属性值发生改变的时候,调用这个方法 /// </summary> /// <param name="sender">依赖项对象</param> /// <param name="e">依赖项属性改变事件 的参数(里面有这个属性的新的值,和旧的值)</param> private static void OnIsCanClickChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { //获取控件 ColorCheckControl _colorCheckControl = sender as ColorCheckControl; //如果是可以点击 if ((bool)e.NewValue == true) { _colorCheckControl.BaseButton.Visibility = Visibility.Visible; _colorCheckControl.ButtonImageBorder.Opacity = 1; } //如果是不可点击 else { _colorCheckControl.BaseButton.Visibility = Visibility.Collapsed; _colorCheckControl.ButtonImageBorder.Opacity = 0.7f; } }
/// <summary> /// 依赖项属性发生改变时,触发的事件: /// 当IsCheckedProperty依赖项属性,的属性值发生改变的时候,调用这个方法 /// </summary> /// <param name="sender">依赖项对象</param> /// <param name="e">依赖项属性改变事件 的参数(里面有这个属性的新的值,和旧的值)</param> private static void OnIsCheckedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { //获取控件 ColorCheckControl _colorCheckControl = sender as ColorCheckControl; //如果是选中 if ((bool)e.NewValue == true) { /* 更改按钮的背景 */ //创建绑定数据 Binding _bindingBackground = new Binding() { ElementName = "ColorCheckUserControl", //要绑定的控件名称 Path = new PropertyPath("CheckedBackground"), // 需绑定的属性名 }; //重新绑定 _colorCheckControl.ButtonImageBorder.SetBinding(BackgroundProperty, _bindingBackground); /* 更改按钮的线段 */ //创建绑定数据 Binding _bindingBorderBrush = new Binding() { ElementName = "ColorCheckUserControl", //要绑定的控件名称 Path = new PropertyPath("CheckedBorderBrush"), // 需绑定的属性名 }; //重新绑定 _colorCheckControl.ButtonImageBorder.SetBinding(BorderBrushProperty, _bindingBorderBrush); } //如果是未选中 else { /* 更改按钮的背景 */ //创建绑定数据 Binding _bindingBackground = new Binding() { ElementName = "ColorCheckUserControl", //要绑定的控件名称 Path = new PropertyPath("MouseLeaveBackground"), // 需绑定的属性名 }; //重新绑定 _colorCheckControl.ButtonImageBorder.SetBinding(BackgroundProperty, _bindingBackground); /* 更改按钮的线段 */ //创建绑定数据 Binding _bindingBorderBrush = new Binding() { ElementName = "ColorCheckUserControl", //要绑定的控件名称 Path = new PropertyPath("MouseLeaveBorderBrush"), // 需绑定的属性名 }; //重新绑定 _colorCheckControl.ButtonImageBorder.SetBinding(BorderBrushProperty, _bindingBorderBrush); } //触发事件 if ((bool)e.NewValue != (bool)e.OldValue) { _colorCheckControl.OnIsCheckedChange((bool)e.OldValue, (bool)e.NewValue);//触发事件 if ((bool)e.NewValue == true) { _colorCheckControl.OnChecked();//触发事件 } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.BugListItemUserControl = ((EasyBugManager.BugListItemControl)(target)); #line 13 "..\..\..\..\..\..\Xaml\Control\Perfab\ListUi\BugListItemControl.xaml" this.BugListItemUserControl.DataContextChanged += new System.Windows.DependencyPropertyChangedEventHandler(this.BugListItemControl_OnDataContextChanged); #line default #line hidden #line 14 "..\..\..\..\..\..\Xaml\Control\Perfab\ListUi\BugListItemControl.xaml" this.BugListItemUserControl.LostFocus += new System.Windows.RoutedEventHandler(this.BugListItemControl_OnLostFocus); #line default #line hidden return; case 2: this.BaseCheckControl = ((EasyBugManager.ColorCheckControl)(target)); return; case 3: this.TipStackPanel = ((System.Windows.Controls.StackPanel)(target)); return; case 4: this.RefreshButtonControl = ((EasyBugManager.ColorButtonControl)(target)); return; case 5: this.GoToPageButtonControl = ((EasyBugManager.ColorButtonControl)(target)); return; case 6: this.GoToPageNumberTextBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 7: this.UndoneProgressBorder = ((System.Windows.Controls.Border)(target)); return; case 8: this.SolvedProgressBorder = ((System.Windows.Controls.Border)(target)); return; case 9: this.DeprecatProgressBorder = ((System.Windows.Controls.Border)(target)); return; case 10: this.RedProgressButton = ((EasyBugManager.ColorButtonControl)(target)); return; case 11: this.GreyProgressButton = ((EasyBugManager.ColorButtonControl)(target)); return; case 12: this.PriorityGrid = ((System.Windows.Controls.Grid)(target)); return; case 13: this.LowPriorityBorder = ((System.Windows.Controls.Border)(target)); return; case 14: this.MidPriorityBorder = ((System.Windows.Controls.Border)(target)); return; case 15: this.HighPriorityBorder = ((System.Windows.Controls.Border)(target)); return; case 16: this.TitleTextBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 17: this.CreateTimeTextBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 18: this.UpdateTimeTextBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 19: this.MoreButtonControl = ((EasyBugManager.ColorButtonControl)(target)); return; case 20: this.DeletedGrid = ((System.Windows.Controls.Grid)(target)); return; case 21: this.DeletedButtonControl = ((EasyBugManager.ColorButtonControl)(target)); return; case 22: this.DeletedBorder = ((System.Windows.Controls.Border)(target)); return; case 23: this.ClickRefreshBorder = ((System.Windows.Controls.Border)(target)); return; case 24: this.ContextMenuPopup = ((System.Windows.Controls.Primitives.Popup)(target)); #line 290 "..\..\..\..\..\..\Xaml\Control\Perfab\ListUi\BugListItemControl.xaml" this.ContextMenuPopup.Opened += new System.EventHandler(this.ContextMenuPopup_Opened); #line default #line hidden #line 290 "..\..\..\..\..\..\Xaml\Control\Perfab\ListUi\BugListItemControl.xaml" this.ContextMenuPopup.Closed += new System.EventHandler(this.ContextMenuPopup_Closed); #line default #line hidden return; case 25: this.ContextMenuControl = ((EasyBugManager.BugListItemContextMenuControl)(target)); return; } this._contentLoaded = true; }