public AddinViewer()
        {
            Xceed.Wpf.Toolkit.MessageBox        ss = new Xceed.Wpf.Toolkit.MessageBox();
            Xceed.Wpf.Toolkit.AutoSelectTextBox at = new AutoSelectTextBox();
            // ColorZoneAssist.SetMode(new CheckBox(), ColorZoneMode.Accent);
            //Hue hue = new Hue("xyz", System.Windows.Media.Color.FromArgb(1, 2, 3, 4), System.Windows.Media.Color.FromArgb(1, 5, 6, 7));

            //Du.Setting.DuSWExPathManager.LoadMaterialDesignDll();
            //Du.Setting.DuSWExPathManager.LoadMaterialDesignDll();

            InitializeComponent();
            //判断是否以管理员权限运行
            //if (Du.Setting.DuSWExPathManager.IsAdministrator())
            //{
            //    viewmodel = new AddinViewerViewModel();

            //    DataContext = viewmodel;

            //    AdminInfo.Visibility = Visibility.Collapsed;

            //}
            //else
            //{
            //    AdminInfo.Visibility = Visibility.Visible;
            //}
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            mBorderPanel = GetTemplateChild(PART_PANEL) as Border;
            if (mBorderPanel != null)
            {
            }
            mTxtTextBox = GetTemplateChild(PART_TEXTBOX) as AutoSelectTextBox;
            if (mTxtTextBox != null)
            {
                mTxtTextBox.TextChanged += TxtTextBox_TextChanged;
            }
            mTxtIntTextBox = GetTemplateChild(PART_INTTEXTBOX) as IntegerUpDown;
            if (mTxtIntTextBox != null)
            {
                mTxtIntTextBox.ValueChanged += TxtIntTextBox_ValueChanged;
            }
            mTxtDoubleTextBox = GetTemplateChild(PART_DOUBLETEXTBOX) as DoubleUpDown;
            if (mTxtDoubleTextBox != null)
            {
                mTxtDoubleTextBox.ValueChanged += mTxtDoubleTextBox_ValueChanged;
            }
            mBoolCheckBox = GetTemplateChild(PART_BOOLCHECKBOX) as CheckBox;
            if (mBoolCheckBox != null)
            {
                mBoolCheckBox.Click += BoolCheckBox_Click;
            }
            mDatetimeTextBox = GetTemplateChild(PART_DATETIMETEXTBOX) as DateTimePicker;
            if (mDatetimeTextBox != null)
            {
                mDatetimeTextBox.ValueChanged += mDatetimeTextBox_ValueChanged;
            }
            mItemSelectControl = GetTemplateChild(PART_ITEMSSELECTCONTROL) as Selector;
            if (mItemSelectControl != null)
            {
                mItemSelectControl.ItemsSource       = mListEnumValueItems;
                mItemSelectControl.SelectionChanged += ItemSelectControl_SelectionChanged;
                ShowValue();
            }
            mColorPickerTextBox = GetTemplateChild(PART_COLORTEXTBOX) as ColorPicker;
            if (mColorPickerTextBox != null)
            {
                mColorPickerTextBox.SelectedColorChanged += mColorPickerTextBox_SelectedColorChanged;
            }
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            mBorderPanel = GetTemplateChild(PART_Panel) as Border;
            if (mBorderPanel != null)
            {
            }
            mTextBlockValue = GetTemplateChild(PART_TextBlock) as TextBlock;
            if (mTextBlockValue != null)
            {
            }
            mTextBoxValue = GetTemplateChild(PART_TextBox) as AutoSelectTextBox;
            if (mTextBoxValue != null)
            {
                mTextBoxValue.TextChanged += mTextBoxValue_TextChanged;
            }
            mIntTextBoxValue = GetTemplateChild(PART_IntTextBox) as IntegerUpDown;
            if (mIntTextBoxValue != null)
            {
                mIntTextBoxValue.ValueChanged += mIntTextBoxValue_ValueChanged;
            }

            mItemsSelectControlValue = GetTemplateChild(PART_ItemsSelectControl) as Selector;
            if (mItemsSelectControlValue != null)
            {
                mItemsSelectControlValue.SelectionChanged += mItemsSelectControlValue_SelectionChanged;
                var combo = mItemsSelectControlValue as ComboBox;
                if (combo != null)
                {
                    combo.DropDownOpened += ComboBox_DropDownOpened;
                    combo.AddHandler(TextBox.TextChangedEvent, new TextChangedEventHandler(ComboBox_TextChanged));
                }
                mItemsSelectControlValue.ItemsSource = mListPropertyValueEnumItems;
                ShowValue();
                //SetDefaultValue();
            }
        }