Exemplo n.º 1
0
        /// <summary>
        /// 依赖项属性发生改变时,触发的事件:
        /// 当ProgressTypeProperty依赖项属性,的属性值发生改变的时候,调用这个方法
        /// </summary>
        /// <param name="sender">依赖项对象</param>
        /// <param name="e">依赖项属性改变事件 的参数(里面有这个属性的新的值,和旧的值)</param>
        private static void OnProgressTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            //获取控件
            ProgressBubbleButtonControl _progressBubbleButtonControl = sender as ProgressBubbleButtonControl;

            //判断值
            switch ((ProgressType)e.NewValue)
            {
            //如果是空
            case ProgressType.None:
                _progressBubbleButtonControl.TextBorder.Background = null;
                break;

            //如果是未完成
            case ProgressType.Undone:
                _progressBubbleButtonControl.TextBorder.Background = _progressBubbleButtonControl.UndoneImage;
                break;

            //如果是已完成
            case ProgressType.Solved:
                _progressBubbleButtonControl.TextBorder.Background = _progressBubbleButtonControl.SolvedImage;
                break;

            //如果是已废弃
            case ProgressType.Deprecat:
                _progressBubbleButtonControl.TextBorder.Background = _progressBubbleButtonControl.DeprecatImage;
                break;
            }
        }
Exemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ProgressBubbleButtonUserControl = ((EasyBugManager.ProgressBubbleButtonControl)(target));
                return;

            case 2:
                this.BaseButton = ((System.Windows.Controls.Button)(target));

            #line 22 "..\..\..\..\..\..\Xaml\Control\Perfab\BugUi\ProgressBubbleButtonControl.xaml"
                this.BaseButton.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Button_OnPreviewMouseDown);

            #line default
            #line hidden

            #line 23 "..\..\..\..\..\..\Xaml\Control\Perfab\BugUi\ProgressBubbleButtonControl.xaml"
                this.BaseButton.PreviewMouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Button_OnPreviewMouseUp);

            #line default
            #line hidden

            #line 24 "..\..\..\..\..\..\Xaml\Control\Perfab\BugUi\ProgressBubbleButtonControl.xaml"
                this.BaseButton.MouseEnter += new System.Windows.Input.MouseEventHandler(this.BaseButton_OnMouseEnter);

            #line default
            #line hidden

            #line 25 "..\..\..\..\..\..\Xaml\Control\Perfab\BugUi\ProgressBubbleButtonControl.xaml"
                this.BaseButton.MouseLeave += new System.Windows.Input.MouseEventHandler(this.BaseButton_OnMouseLeave);

            #line default
            #line hidden

            #line 26 "..\..\..\..\..\..\Xaml\Control\Perfab\BugUi\ProgressBubbleButtonControl.xaml"
                this.BaseButton.Click += new System.Windows.RoutedEventHandler(this.Button_OnClick);

            #line default
            #line hidden
                return;

            case 3:
                this.BubbleBorder = ((System.Windows.Controls.Border)(target));
                return;

            case 4:
                this.TextBorder = ((System.Windows.Controls.Border)(target));
                return;

            case 5:
                this.BaseButtonScaleTransform = ((System.Windows.Media.ScaleTransform)(target));
                return;
            }
            this._contentLoaded = true;
        }