/// <summary>
        /// 依赖项属性发生改变时,触发的事件:
        /// 当ThemeProperty依赖项属性,的属性值发生改变的时候,调用这个方法
        /// </summary>
        /// <param name="sender">依赖项对象</param>
        /// <param name="e">依赖项属性改变事件 的参数(里面有这个属性的新的值,和旧的值)</param>
        private static void OnThemeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            //如果值发生改变了
            if ((ThemeType)e.OldValue != (ThemeType)e.NewValue)
            {
                //获取控件
                SettingsUiControl _settingsUiControl = sender as SettingsUiControl;

                //判断
                switch ((ThemeType)e.NewValue)
                {
                //如果值为[白]
                case ThemeType.White:
                    //修改CheckGroup
                    _settingsUiControl.EnThemeCheckGroup.CheckedIndex     = 0;
                    _settingsUiControl.CnThemeCheckGroup.CheckedIndex     = 0;
                    _settingsUiControl.EnThemeBearCheckGroup.CheckedIndex = 0;
                    _settingsUiControl.CnThemeBearCheckGroup.CheckedIndex = 0;
                    _settingsUiControl.EnThemeCatCheckGroup.CheckedIndex  = -1;
                    _settingsUiControl.CnThemeCatCheckGroup.CheckedIndex  = -1;
                    break;

                //如果值为[黑]
                case ThemeType.Dark:
                    //修改CheckGroup
                    _settingsUiControl.EnThemeCheckGroup.CheckedIndex     = 1;
                    _settingsUiControl.CnThemeCheckGroup.CheckedIndex     = 1;
                    _settingsUiControl.EnThemeBearCheckGroup.CheckedIndex = 1;
                    _settingsUiControl.CnThemeBearCheckGroup.CheckedIndex = 1;
                    _settingsUiControl.EnThemeCatCheckGroup.CheckedIndex  = -1;
                    _settingsUiControl.CnThemeCatCheckGroup.CheckedIndex  = -1;
                    break;

                //如果值为[猫(白色)]
                case ThemeType.Cat_White:
                    //修改CheckGroup
                    _settingsUiControl.EnThemeCheckGroup.CheckedIndex     = -1;
                    _settingsUiControl.CnThemeCheckGroup.CheckedIndex     = -1;
                    _settingsUiControl.EnThemeBearCheckGroup.CheckedIndex = -1;
                    _settingsUiControl.CnThemeBearCheckGroup.CheckedIndex = -1;
                    _settingsUiControl.EnThemeCatCheckGroup.CheckedIndex  = 0;
                    _settingsUiControl.CnThemeCatCheckGroup.CheckedIndex  = 0;
                    break;

                //如果值为[猫(黑色)]
                case ThemeType.Cat_Dark:
                    //修改CheckGroup
                    _settingsUiControl.EnThemeCheckGroup.CheckedIndex     = -1;
                    _settingsUiControl.CnThemeCheckGroup.CheckedIndex     = -1;
                    _settingsUiControl.EnThemeBearCheckGroup.CheckedIndex = -1;
                    _settingsUiControl.CnThemeBearCheckGroup.CheckedIndex = -1;
                    _settingsUiControl.EnThemeCatCheckGroup.CheckedIndex  = 1;
                    _settingsUiControl.CnThemeCatCheckGroup.CheckedIndex  = 1;
                    break;
                }

                //触发事件
                _settingsUiControl.OnThemeChange((ThemeType)e.NewValue);
            }
        }
        /// <summary>
        /// 依赖项属性发生改变时,触发的事件:
        /// 当SoundProperty依赖项属性,的属性值发生改变的时候,调用这个方法
        /// </summary>
        /// <param name="sender">依赖项对象</param>
        /// <param name="e">依赖项属性改变事件 的参数(里面有这个属性的新的值,和旧的值)</param>
        private static void OnSoundChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            //如果值发生改变了
            if ((bool)e.OldValue != (bool)e.NewValue)
            {
                //获取控件
                SettingsUiControl _settingsUiControl = sender as SettingsUiControl;

                //判断
                switch ((bool)e.NewValue)
                {
                //如果值为[开]
                case true:
                    //修改CheckGroup
                    _settingsUiControl.EnSoundCheckGroup.CheckedIndex = 0;
                    _settingsUiControl.CnSoundCheckGroup.CheckedIndex = 0;
                    break;

                //如果值为[关]
                case false:
                    //修改CheckGroup
                    _settingsUiControl.EnSoundCheckGroup.CheckedIndex = 1;
                    _settingsUiControl.CnSoundCheckGroup.CheckedIndex = 1;
                    break;
                }

                //触发事件
                _settingsUiControl.OnSoundChange((bool)e.NewValue);
            }
        }
        /// <summary>
        /// 依赖项属性发生改变时,触发的事件:
        /// 当TransparentProperty依赖项属性,的属性值发生改变的时候,调用这个方法
        /// </summary>
        /// <param name="sender">依赖项对象</param>
        /// <param name="e">依赖项属性改变事件 的参数(里面有这个属性的新的值,和旧的值)</param>
        private static void OnTransparentChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            //如果值发生改变了
            if ((int)e.OldValue != (int)e.NewValue)
            {
                //获取控件
                SettingsUiControl _settingsUiControl = sender as SettingsUiControl;

                //触发事件
                _settingsUiControl.OnTransparentChange((int)e.NewValue);
            }
        }
        /// <summary>
        /// 依赖项属性发生改变时,触发的事件:
        /// 当LanguageProperty依赖项属性,的属性值发生改变的时候,调用这个方法
        /// </summary>
        /// <param name="sender">依赖项对象</param>
        /// <param name="e">依赖项属性改变事件 的参数(里面有这个属性的新的值,和旧的值)</param>
        private static void OnLanguageChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            //如果值发生改变了
            if ((LanguageType)e.OldValue != (LanguageType)e.NewValue)
            {
                //获取控件
                SettingsUiControl _settingsUiControl = sender as SettingsUiControl;

                //判断
                switch ((LanguageType)e.NewValue)
                {
                //如果值为[英文]
                case LanguageType.English:
                    //打开英语面板,关闭中文面板
                    _settingsUiControl.EnStackPanel.Visibility = Visibility.Visible;
                    _settingsUiControl.CnStackPanel.Visibility = Visibility.Collapsed;
                    //修改CheckGroup
                    _settingsUiControl.EnLanguageCheckGroup.CheckedIndex = 0;
                    _settingsUiControl.CnLanguageCheckGroup.CheckedIndex = 0;
                    break;

                //如果值为[中文]
                case LanguageType.Chinese:
                    //打开中文面板,关闭英文面板
                    _settingsUiControl.EnStackPanel.Visibility = Visibility.Collapsed;
                    _settingsUiControl.CnStackPanel.Visibility = Visibility.Visible;
                    //修改CheckGroup
                    _settingsUiControl.EnLanguageCheckGroup.CheckedIndex = 1;
                    _settingsUiControl.CnLanguageCheckGroup.CheckedIndex = 1;
                    break;
                }

                //触发事件
                _settingsUiControl.OnLanguageChange((LanguageType)e.NewValue);
            }
        }
Exemplo n.º 5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.SettingsUiUserControl = ((EasyBugManager.SettingsUiControl)(target));

            #line 13 "..\..\..\..\..\Xaml\Control\Ui\SettingsUiControl.xaml"
                this.SettingsUiUserControl.IsVisibleChanged += new System.Windows.DependencyPropertyChangedEventHandler(this.SettingsUiUserControl_IsVisibleChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.BackgroundBorder = ((System.Windows.Controls.Border)(target));
                return;

            case 3:
                this.StaffGrid = ((System.Windows.Controls.Grid)(target));

            #line 37 "..\..\..\..\..\Xaml\Control\Ui\SettingsUiControl.xaml"
                this.StaffGrid.MouseEnter += new System.Windows.Input.MouseEventHandler(this.StaffPanelControl_MouseEnter);

            #line default
            #line hidden

            #line 38 "..\..\..\..\..\Xaml\Control\Ui\SettingsUiControl.xaml"
                this.StaffGrid.MouseLeave += new System.Windows.Input.MouseEventHandler(this.StaffPanelControl_MouseLeave);

            #line default
            #line hidden
                return;

            case 4:
                this.StaffTextGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.CnStackPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 6:
                this.CnLanguageCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 7:
                this.CnSoundCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 8:
                this.CnThemeGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 9:
                this.CnThemeCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 10:
                this.CnThemeBearGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 11:
                this.CnThemeBearCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 12:
                this.CnThemeCatGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 13:
                this.CnThemeCatCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 14:

            #line 426 "..\..\..\..\..\Xaml\Control\Ui\SettingsUiControl.xaml"
                ((System.Windows.Controls.StackPanel)(target)).MouseEnter += new System.Windows.Input.MouseEventHandler(this.CnTransparentStackPanel_MouseEnter);

            #line default
            #line hidden

            #line 427 "..\..\..\..\..\Xaml\Control\Ui\SettingsUiControl.xaml"
                ((System.Windows.Controls.StackPanel)(target)).MouseLeave += new System.Windows.Input.MouseEventHandler(this.CnTransparentStackPanel_MouseLeave);

            #line default
            #line hidden
                return;

            case 15:
                this.CnTransparentSlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 16:
                this.CnTransparentBorder = ((System.Windows.Controls.Border)(target));
                return;

            case 17:
                this.EnStackPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 18:
                this.EnLanguageCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 19:
                this.EnSoundCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 20:
                this.EnThemeGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 21:
                this.EnThemeCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 22:
                this.EnThemeBearGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 23:
                this.EnThemeBearCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 24:
                this.EnThemeCatGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 25:
                this.EnThemeCatCheckGroup = ((EasyBugManager.ImageCheckGroupControl)(target));
                return;

            case 26:

            #line 645 "..\..\..\..\..\Xaml\Control\Ui\SettingsUiControl.xaml"
                ((System.Windows.Controls.StackPanel)(target)).MouseEnter += new System.Windows.Input.MouseEventHandler(this.EnTransparentStackPanel_MouseEnter);

            #line default
            #line hidden

            #line 646 "..\..\..\..\..\Xaml\Control\Ui\SettingsUiControl.xaml"
                ((System.Windows.Controls.StackPanel)(target)).MouseLeave += new System.Windows.Input.MouseEventHandler(this.EnTransparentStackPanel_MouseLeave);

            #line default
            #line hidden
                return;

            case 27:
                this.EnTransparentSlider = ((System.Windows.Controls.Slider)(target));
                return;

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

            #line 23 "..\..\MainWindow.xaml"
                ((EasyBugManager.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.MainWindow_OnLoaded);

            #line default
            #line hidden
                return;

            case 2:
                this.BackgroudBorder = ((System.Windows.Controls.Border)(target));
                return;

            case 3:
                this.DragBackgroudGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 4:

            #line 78 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Border)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.WindowTitleBorder_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

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

            case 6:
                this.MainUiControl = ((EasyBugManager.MainUiControl)(target));
                return;

            case 7:
                this.ListUiControl = ((EasyBugManager.ListUiControl)(target));
                return;

            case 8:
                this.BugUiControl = ((EasyBugManager.BugUiControl)(target));
                return;

            case 9:
                this.SyncUiControl = ((EasyBugManager.SyncUiControl)(target));
                return;

            case 10:
                this.ImageUiControl = ((EasyBugManager.ImageUiControl)(target));
                return;

            case 11:
                this.DragForegroundGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 12:

            #line 259 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Border)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.WindowTitleBorder_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

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

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

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

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

            case 17:
                this.ChangeBugUiControl = ((EasyBugManager.ChangeBugUiControl)(target));
                return;

            case 18:
                this.DeleteBugTipUiControl = ((EasyBugManager.DeleteTipUiControl)(target));
                return;

            case 19:
                this.DeleteRecordTipUiControl = ((EasyBugManager.DeleteTipUiControl)(target));
                return;

            case 20:
                this.BaseTipUiControl = ((EasyBugManager.TipUiControl)(target));
                return;

            case 21:
                this.LatelyProjectTipUiControl = ((EasyBugManager.TipUiControl)(target));
                return;

            case 22:
                this.ErrorUiControl = ((EasyBugManager.ErrorUiControl)(target));
                return;
            }
            this._contentLoaded = true;
        }