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

            //判断排序的类型
            switch ((SortType)e.NewValue)
            {
            //如果不排序
            case SortType.None:
                /* 更改图片*/
                //创建绑定数据
                Binding _binding_None = new Binding()
                {
                    ElementName = "ListHeadButtonUserControl",        //要绑定的控件名称
                    Path        = new PropertyPath("ArrowNoneImage"), // 需绑定的属性名
                };
                //重新绑定
                _listHeadButtonControl.ListHandArrowBorder.SetBinding(BackgroundProperty, _binding_None);
                break;

            //如果从低到高排序
            case SortType.LowToHigh:
                /* 更改图片*/
                //创建绑定数据
                Binding _binding_LowToHigh = new Binding()
                {
                    ElementName = "ListHeadButtonUserControl",      //要绑定的控件名称
                    Path        = new PropertyPath("ArrowUpImage"), // 需绑定的属性名
                };
                //重新绑定
                _listHeadButtonControl.ListHandArrowBorder.SetBinding(BackgroundProperty, _binding_LowToHigh);
                break;

            //如果从高到低排序
            case SortType.HighToLow:
                /* 更改图片*/
                //创建绑定数据
                Binding _binding_HighToLow = new Binding()
                {
                    ElementName = "ListHeadButtonUserControl",        //要绑定的控件名称
                    Path        = new PropertyPath("ArrowDownImage"), // 需绑定的属性名
                };
                //重新绑定
                _listHeadButtonControl.ListHandArrowBorder.SetBinding(BackgroundProperty, _binding_HighToLow);
                break;
            }
        }
        /// <summary>
        /// 依赖项属性发生改变时,触发的事件:
        /// 当IsCanClickProperty依赖项属性,的属性值发生改变的时候,调用这个方法
        /// </summary>
        /// <param name="sender">依赖项对象</param>
        /// <param name="e">依赖项属性改变事件 的参数(里面有这个属性的新的值,和旧的值)</param>
        private static void OnIsCanClickChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            //获取控件的对象
            ListHeadButtonControl _listHeadButtonControl = sender as ListHeadButtonControl;

            //如果isCanClick为true
            if ((bool)e.NewValue == true)
            {
                //那就把Button启用
                _listHeadButtonControl.ListHeadColorButtonControl.Visibility = Visibility.Visible;
            }
            else
            {
                //那就把Button禁用
                _listHeadButtonControl.ListHeadColorButtonControl.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ListHeadButtonUserControl = ((EasyBugManager.ListHeadButtonControl)(target));
                return;

            case 2:
                this.ListHeadColorButtonControl = ((EasyBugManager.ColorButtonControl)(target));
                return;

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

            case 4:
                this.ListHandArrowBorder = ((System.Windows.Controls.Border)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ListUiUserControl = ((EasyBugManager.ListUiControl)(target));

            #line 13 "..\..\..\..\..\Xaml\Control\Ui\ListUiControl.xaml"
                this.ListUiUserControl.Loaded += new System.Windows.RoutedEventHandler(this.ListUiControl_OnLoaded);

            #line default
            #line hidden
                return;

            case 2:
                this.TopButtonGroupStackPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 3:
                this.MinimizeButtonControl = ((EasyBugManager.MinimizeButtonControl)(target));
                return;

            case 4:
                this.CloseButtonControl = ((EasyBugManager.NoButtonControl)(target));
                return;

            case 5:
                this.SettingButtonControl = ((EasyBugManager.SettingButtonControl)(target));
                return;

            case 6:
                this.ProjectNameTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.UndoneBugNumberTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 8:
                this.PriorityHighBugNumberTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 9:
                this.PriorityMidBugNumberTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 10:
                this.PriorityLowBugNumberTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 11:
                this.SearchTextBox = ((System.Windows.Controls.TextBox)(target));

            #line 187 "..\..\..\..\..\Xaml\Control\Ui\ListUiControl.xaml"
                this.SearchTextBox.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.SearchTextBox_TextChanged);

            #line default
            #line hidden
                return;

            case 12:
                this.ClearSearchButtonControl = ((EasyBugManager.ImageButtonControl)(target));
                return;

            case 13:
                this.ProgressListHeadButtonControl = ((EasyBugManager.ListHeadButtonControl)(target));
                return;

            case 14:
                this.PriorityListHeadButtonControl = ((EasyBugManager.ListHeadButtonControl)(target));
                return;

            case 15:
                this.CreateTimeListHeadButtonControl = ((EasyBugManager.ListHeadButtonControl)(target));
                return;

            case 16:
                this.UpdateTimeListHeadButtonControl = ((EasyBugManager.ListHeadButtonControl)(target));
                return;

            case 17:
                this.BugListBox = ((System.Windows.Controls.ListBox)(target));
                return;

            case 18:
                this.BugListItemControl1 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 19:
                this.BugListItemControl2 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 20:
                this.BugListItemControl3 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 21:
                this.BugListItemControl4 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 22:
                this.BugListItemControl5 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 23:
                this.BugListItemControl6 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 24:
                this.BugListItemControl7 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 25:
                this.BugListItemControl8 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 26:
                this.BugListItemControl9 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 27:
                this.BugListItemControl10 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 28:
                this.BugListItemControl11 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 29:
                this.BugListItemControl12 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 30:
                this.BugListItemControl13 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 31:
                this.BugListItemControl14 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 32:
                this.BugListItemControl15 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 33:
                this.BugListItemControl16 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 34:
                this.BugListItemControl17 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 35:
                this.BugListItemControl18 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 36:
                this.BugListItemControl19 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 37:
                this.BugListItemControl20 = ((EasyBugManager.BugListItemControl)(target));
                return;

            case 38:
                this.ShowBugNumberCheckGroupControl = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 39:
                this.PreviousPageButtonControl = ((EasyBugManager.ColorButtonControl)(target));
                return;

            case 40:
                this.CurrentPageNumberTextBox = ((System.Windows.Controls.TextBox)(target));

            #line 911 "..\..\..\..\..\Xaml\Control\Ui\ListUiControl.xaml"
                this.CurrentPageNumberTextBox.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.CurrentPageNumberTextBox_TextChanged);

            #line default
            #line hidden

            #line 915 "..\..\..\..\..\Xaml\Control\Ui\ListUiControl.xaml"
                this.CurrentPageNumberTextBox.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.CurrentPageNumberTextBox_PreviewTextInput);

            #line default
            #line hidden

            #line 916 "..\..\..\..\..\Xaml\Control\Ui\ListUiControl.xaml"
                this.CurrentPageNumberTextBox.PreviewKeyDown += new System.Windows.Input.KeyEventHandler(this.CurrentPageNumberTextBox_PreviewKeyDown);

            #line default
            #line hidden
                return;

            case 41:
                this.TotalPageNumberTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 42:
                this.NextPageButtonControl = ((EasyBugManager.ColorButtonControl)(target));
                return;

            case 43:
                this.ListTipControl = ((EasyBugManager.ListTipControl)(target));
                return;

            case 44:
                this.ForegroundCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 45:
                this.TopButtonForegroundGroupStackPanel = ((System.Windows.Controls.StackPanel)(target));
                return;
            }
            this._contentLoaded = true;
        }