///<summary>示波器控件</summary> static OscilloscopeControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(OscilloscopeControl), new FrameworkPropertyMetadata(typeof(OscilloscopeControl))); ForegroundProperty.OverrideMetadata(typeof(OscilloscopeControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender, new PropertyChangedCallback((DependencyObject d, DependencyPropertyChangedEventArgs e) => { if (e.NewValue != null) { var sender = d as OscilloscopeControl; if (sender != null && sender.m_IsPropertyEnabled) { var temp = e.NewValue as SolidColorBrush; if (temp != null) { sender.m_Core.ChangeForegroundColor(ColorHelper.ToColorValue(temp.Color)); } } } }))); BackgroundProperty.OverrideMetadata(typeof(OscilloscopeControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender, new PropertyChangedCallback((DependencyObject d, DependencyPropertyChangedEventArgs e) => { if (e.NewValue != null) { var sender = d as OscilloscopeControl; if (sender != null && sender.m_IsPropertyEnabled) { var temp = e.NewValue as SolidColorBrush; if (temp != null) { sender.m_Core.ChangeBackgroundColor(ColorHelper.ToColorValue(temp.Color)); } } } }))); }
static IconElement() { ForegroundProperty.OverrideMetadata(typeof(IconElement), new FrameworkPropertyMetadata(SystemColors.ControlTextBrush, FrameworkPropertyMetadataOptions.Inherits, (sender, e) => ((IconElement)sender).OnForegroundPropertyChanged(e))); }
static ExtendedTextBox() { BackgroundProperty.OverrideMetadata(typeof(ExtendedTextBox), new FrameworkPropertyMetadata(new SolidColorBrush(Colors.White), OnBackgroundPropertyChanged)); BorderBrushProperty.OverrideMetadata(typeof(ExtendedTextBox), new FrameworkPropertyMetadata(new SolidColorBrush(Color.FromArgb(0xFF, 0xAB, 0xAD, 0xB3)), OnBorderBrushPropertyChanged)); ForegroundProperty.OverrideMetadata(typeof(ExtendedTextBox), new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Black), OnForegroundPropertyChanged)); OpacityMaskProperty.OverrideMetadata(typeof(ExtendedTextBox), new FrameworkPropertyMetadata(null, OnOpacityMaskPropertyChanged)); }
static HitTextBlock() { FontFamilyProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); FontSizeProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); FontWeightProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); FontStyleProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); ForegroundProperty.OverrideMetadata(typeof(HitTextBlock), new FrameworkPropertyMetadata(OnTextAffectingPropertyChanged)); }
static MatrixView() { ForegroundProperty.OverrideMetadata( typeof(MatrixView), new FrameworkPropertyMetadata( SystemColors.ControlTextBrush, FrameworkPropertyMetadataOptions.Inherits, new PropertyChangedCallback(OnForegroundPropertyChanged))); }
static ProgressBar() { FocusableProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox)); DefaultStyleKeyProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata(typeof(ProgressBar))); _dType = DependencyObjectType.FromSystemTypeInternal(typeof(ProgressBar)); // Set default to 100.0 RangeBase.MaximumProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata(100.0)); ForegroundProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata(OnForegroundChanged)); }
static ProgressBar() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata(typeof(ProgressBar))); BackgroundProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata { CoerceValueCallback = CoerceBrush }); ForegroundProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata { CoerceValueCallback = CoerceBrush }); }
static BlackKey() { BackgroundProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(Brushes.Black)); DefaultStyleKeyProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(typeof(BlackKey))); ForegroundProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(Brushes.White)); HeightProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(95.0)); MarginProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(new Thickness(-100.0, 0, -100.0, 0.0))); VerticalAlignmentProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(VerticalAlignment.Top)); WidthProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(11.0)); Panel.ZIndexProperty.OverrideMetadata(typeof(BlackKey), new FrameworkPropertyMetadata(1)); }
static TextBlock() { TextProperty.OverrideMetadata(typeof(TextBlock), new FrameworkPropertyMetadata( "", (o, e) => (o as TextBlock).TextChangedCallback(e.NewValue as string), (o, v) => (o as TextBlock).CoerceTextCallback(v as string))); ForegroundProperty.OverrideMetadata(typeof(TextBlock), new FrameworkPropertyMetadata( Brushes.Black, (o, e) => (o as TextBlock).ForegroundChangedCallback(e.NewValue as Brush))); }
static RatingSlider() { ValueProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: 0d, RecalculateRelativeValues)); MinimumProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: 0d, RecalculateRelativeValues)); MaximumProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: 10d, RecalculateRelativeValues)); WidthProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: 0d, RecalculateWidth)); ForegroundProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: null, ResolveForeground)); BackgroundProperty.OverrideMetadata(typeof(RatingSlider), new FrameworkPropertyMetadata(defaultValue: null, ResolveBackground)); }
static HexBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(typeof(HexBox))); FontFamilyProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); FontStyleProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); FontWeightProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); FontStretchProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); FontSizeProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); ForegroundProperty.OverrideMetadata(typeof(HexBox), new FrameworkPropertyMetadata(OnTypographyChanged)); }
static TextBlock() { TextProperty.OverrideMetadata(typeof(TextBlock), new FrameworkPropertyMetadata( (string)Controls.TextBlock.TextProperty.GetMetadata(typeof(Controls.TextBlock)).DefaultValue, (o, e) => (o as TextBlock).OnTextChanged(e.NewValue as string))); ForegroundProperty.OverrideMetadata(typeof(TextBlock), new FrameworkPropertyMetadata( (Brush)ForegroundProperty.GetMetadata(typeof(Controls.TextBlock)).DefaultValue, (o, e) => (o as TextBlock).OnForegroundChanged(e.NewValue as Brush))); FontSizeProperty.OverrideMetadata(typeof(TextBlock), new FrameworkPropertyMetadata( (double)FontSizeProperty.GetMetadata(typeof(Controls.TextBlock)).DefaultValue, (o, e) => (o as TextBlock).OnFontSizeChanged((double)e.NewValue))); }
static TimeScale() { WidthProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(Double.NaN)); HeightProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(30d)); ClipToBoundsProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(true)); ForegroundProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(Brushes.Gray)); BackgroundProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(Brushes.Transparent)); IntervalTextColorProperty = DependencyProperty.Register("IntervalTextColor", typeof(Brush), typeof(TimeScale), new FrameworkPropertyMetadata { DefaultValue = Brushes.Gray, AffectsRender = true }); DefaultStyleKeyProperty.OverrideMetadata(typeof(TimeScale), new FrameworkPropertyMetadata(typeof(TimeScale))); }
static FormattedListBoxItem() { #if !DEBUG if (!System.Linq.Enumerable.SequenceEqual( typeof(FormattedListBoxItem).Assembly.GetName().GetPublicKeyToken(), System.Reflection.Assembly.GetEntryAssembly().GetName().GetPublicKeyToken())) { throw new Exception("You are not licensed to use PosControls.dll"); } #endif BackgroundProperty.OverrideMetadata(typeof(Brush), new FrameworkPropertyMetadata(ConfigurationManager.ListItemBackgroundBrush, new PropertyChangedCallback(BackgroundValueChanged))); ForegroundProperty.OverrideMetadata(typeof(Brush), new FrameworkPropertyMetadata(ConfigurationManager.ListItemBackgroundBrush, new PropertyChangedCallback(ForegroundValueChanged))); }
public EditorTextBox() { ForegroundProperty.OverrideMetadata(typeof(EditorTextBox), new FrameworkPropertyMetadata(Brushes.Transparent, OnForegroundChanged)); BackgroundProperty.OverrideMetadata(typeof(EditorTextBox), new FrameworkPropertyMetadata(OnBackgroundChanged)); Loaded += EditorTextBox_Loaded; HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; VerticalScrollBarVisibility = ScrollBarVisibility.Auto; AcceptsTab = true; AcceptsReturn = true; HighlightText = new NotifyableWordCollection(); HighlightText.ListChanged += HighlightText_ListChanged; TabSize = 4; InitializeComponent(); }
static BitmapIcon() { ForegroundProperty.OverrideMetadata(typeof(BitmapIcon), new FrameworkPropertyMetadata(OnForegroundChanged)); }
static Spinner() { ForegroundProperty.OverrideMetadata(typeof(Spinner), new FrameworkPropertyMetadata(Brushes.Pink)); }
static MaterialTextBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(MaterialTextBox), new FrameworkPropertyMetadata(typeof(MaterialTextBox))); ForegroundProperty.OverrideMetadata(typeof(MaterialTextBox), new FrameworkPropertyMetadata(null, OnForegroundChanged)); }
static BeatVisualizer() { ForegroundProperty.OverrideMetadata(typeof(BeatVisualizer), new FrameworkPropertyMetadata(Brushes.Magenta)); }
static ShipLevelChart() { BackgroundProperty.OverrideMetadata(typeof(ShipLevelChart), new FrameworkPropertyMetadata(ParamsChanges)); ForegroundProperty.OverrideMetadata(typeof(ShipLevelChart), new FrameworkPropertyMetadata(ParamsChanges)); }
static SimpleButton() { DefaultStyleKeyProperty.OverrideMetadata(typeof(SimpleButton), new FrameworkPropertyMetadata(typeof(SimpleButton))); ForegroundProperty.OverrideMetadata(typeof(SimpleButton), new FrameworkPropertyMetadata(OnForegroundChanged)); }