示例#1
0
        static TabItem()
        {
            ItemStateManagerFactoryRegistry.AddStateManagerFactory(new TabItemStateManagerFactory(), typeof(TabItem));

            TextAlignmentProperty.OverrideMetadata(typeof(TabItem), new RadElementPropertyMetadata(ContentAlignment.MiddleLeft,
                                                                                                   ElementPropertyOptions.AffectsLayout |
                                                                                                   ElementPropertyOptions.InvalidatesLayout));
            TextImageRelationProperty.OverrideMetadata(typeof(TabItem), new RadElementPropertyMetadata(TextImageRelation.ImageBeforeText,
                                                                                                       ElementPropertyOptions.AffectsLayout |
                                                                                                       ElementPropertyOptions.InvalidatesLayout |
                                                                                                       ElementPropertyOptions.AffectsMeasure));
        }
示例#2
0
        private void InitializeProperties()
        {
            UpdatePlaceholderVisibility();
            UpdateButtonStates();
            OnInputScopeChanged(CreateInitialValueChangerEventArgs(InputScopeProperty, null, InputScope));
            OnMaxLengthChanged(CreateInitialValueChangerEventArgs(MaxLengthProperty, null, MaxLength));
            OnAcceptsReturnChanged(CreateInitialValueChangerEventArgs(AcceptsReturnProperty, null, AcceptsReturn));
            OnIsReadonlyChanged(CreateInitialValueChangerEventArgs(IsReadOnlyProperty, null, IsReadOnly));
            OnForegroundColorChanged(null, Foreground);
            UpdateFontPartial();
            OnHeaderChanged();
            OnIsTextPredictionEnabledChanged(CreateInitialValueChangerEventArgs(IsTextPredictionEnabledProperty, IsTextPredictionEnabledProperty.GetMetadata(GetType()).DefaultValue, IsTextPredictionEnabled));
            OnIsSpellCheckEnabledChanged(CreateInitialValueChangerEventArgs(IsSpellCheckEnabledProperty, IsSpellCheckEnabledProperty.GetMetadata(GetType()).DefaultValue, IsSpellCheckEnabled));
            OnTextAlignmentChanged(CreateInitialValueChangerEventArgs(TextAlignmentProperty, TextAlignmentProperty.GetMetadata(GetType()).DefaultValue, TextAlignment));
            OnTextWrappingChanged(CreateInitialValueChangerEventArgs(TextWrappingProperty, TextWrappingProperty.GetMetadata(GetType()).DefaultValue, TextWrapping));
            OnFocusStateChanged((FocusState)FocusStateProperty.GetMetadata(GetType()).DefaultValue, FocusState, initial: true);
            OnVerticalContentAlignmentChanged(VerticalAlignment.Top, VerticalContentAlignment);
            OnTextCharacterCasingChanged(CreateInitialValueChangerEventArgs(CharacterCasingProperty, CharacterCasingProperty.GetMetadata(GetType()).DefaultValue, CharacterCasing));

            var buttonRef = _deleteButton?.GetTarget();

            if (buttonRef != null)
            {
                var thisRef = (this as IWeakReferenceProvider).WeakReference;
                buttonRef.Command = new DelegateCommand(() => (thisRef.Target as TextBox)?.DeleteButtonClick());
            }

            InitializePropertiesPartial();
        }
示例#3
0
        private void InitializeProperties()
        {
            OnTextChanged(CreateInitialValueChangerEventArgs(TextProperty, null, Text));
            OnInputScopeChanged(CreateInitialValueChangerEventArgs(InputScopeProperty, null, InputScope));
            OnMaxLengthChanged(CreateInitialValueChangerEventArgs(MaxLengthProperty, null, MaxLength));
            OnAcceptsReturnChanged(CreateInitialValueChangerEventArgs(AcceptsReturnProperty, null, AcceptsReturn));
            OnIsEnabledChanged(false, IsEnabled);
            OnForegroundColorChanged(null, Foreground);
            UpdateFontPartial(this);
            OnHeaderChanged();
            OnIsTextPredictionEnabledChanged(CreateInitialValueChangerEventArgs(IsTextPredictionEnabledProperty, IsTextPredictionEnabledProperty.GetMetadata(GetType()).DefaultValue, IsTextPredictionEnabled));
            OnIsSpellCheckEnabledChanged(CreateInitialValueChangerEventArgs(IsSpellCheckEnabledProperty, IsSpellCheckEnabledProperty.GetMetadata(GetType()).DefaultValue, IsSpellCheckEnabled));
            OnTextAlignmentChanged(CreateInitialValueChangerEventArgs(TextAlignmentProperty, TextAlignmentProperty.GetMetadata(GetType()).DefaultValue, TextAlignment));
            OnTextWrappingChanged(CreateInitialValueChangerEventArgs(TextWrappingProperty, TextWrappingProperty.GetMetadata(GetType()).DefaultValue, TextWrapping));
            OnFocusStateChanged((FocusState)FocusStateProperty.GetMetadata(GetType()).DefaultValue, FocusState);

            var buttonRef = _deleteButton?.GetTarget();

            if (buttonRef != null)
            {
                buttonRef.Command = new DelegateCommand(DeleteText);
            }

            InitializePropertiesPartial();
        }
示例#4
0
 set => SetValue(TextAlignmentProperty, value);