Пример #1
0
        /// <summary>
        /// 设置按钮事件
        /// </summary>
        private void Setting_Click(object sender, RoutedEventArgs e)
        {
            SettingView settingView = SettingView.GetInstance(this);

            settingView.Focus();
            settingView.Show();
        }
Пример #2
0
 /// <summary>
 /// 单例创建
 /// </summary>
 /// <param name="stickyNote">传入便签窗口</param>
 /// <returns>返回创建的设置窗口</returns>
 public static SettingView GetInstance(StickyNoteView stickyNote)
 {
     if (SettingViewSingleton == null)         //双重锁定只需要一句判断就可以了
     {
         lock (locker)                         //线程锁
         {
             if (SettingViewSingleton == null) //判断类是否已经实例化
             {
                 SettingViewSingleton = new SettingView(stickyNote);
             }
         }
     }
     return(SettingViewSingleton);
 }
Пример #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.stickyNoteSettingProp = ((MMY.StickyNote.UI.SettingView)(target));
                return;

            case 2:
                this.StyleComboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 3:
                this.FontSizeShow = ((System.Windows.Controls.Button)(target));
                return;

            case 4:
                this.FontSizeValue = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.ThemeComboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 6:
                this.TopColorShow = ((System.Windows.Controls.Button)(target));
                return;

            case 7:
                this.BackgroundColorShow = ((System.Windows.Controls.Button)(target));
                return;

            case 8:
                this.FontColorShow = ((System.Windows.Controls.Button)(target));
                return;

            case 9:
                this.OpacitySlider = ((System.Windows.Controls.Slider)(target));
                return;

            case 10:
                this.OpacityValue = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.ConfirmButton = ((System.Windows.Controls.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #4
0
 private void SettingView_Closed(object sender, EventArgs e)
 {
     SettingViewSingleton = null;
 }