示例#1
0
        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)));
        }
示例#2
0
 static LayoutGridResizerControl()
 {
     //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
     //This style is defined in themes\generic.xaml
     DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutGridResizerControl),
                                              new FrameworkPropertyMetadata(typeof(LayoutGridResizerControl)));
     HorizontalAlignmentProperty.OverrideMetadata(typeof(LayoutGridResizerControl),
                                                  new FrameworkPropertyMetadata(HorizontalAlignment.Stretch,
                                                                                FrameworkPropertyMetadataOptions.AffectsParentMeasure));
     VerticalAlignmentProperty.OverrideMetadata(typeof(LayoutGridResizerControl),
                                                new FrameworkPropertyMetadata(VerticalAlignment.Stretch,
                                                                              FrameworkPropertyMetadataOptions.AffectsParentMeasure));
     BackgroundProperty.OverrideMetadata(typeof(LayoutGridResizerControl),
                                         new FrameworkPropertyMetadata(Brushes.Transparent));
     IsHitTestVisibleProperty.OverrideMetadata(typeof(LayoutGridResizerControl),
                                               new FrameworkPropertyMetadata(true, null));
 }
        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)));
        }
示例#4
0
        static ZoomPanel()
        {
            ClipToBoundsProperty.OverrideMetadata(typeof(ZoomPanel), new FrameworkPropertyMetadata(true));
            BackgroundProperty.OverrideMetadata(typeof(ZoomPanel), new FrameworkPropertyMetadata(Brushes.Transparent));

            try
            {
                var grabStream     = Application.GetResourceStream(new Uri("Resources\\grab.cur", UriKind.Relative));
                var grabbingStream = Application.GetResourceStream(new Uri("Resources\\grabbing.cur", UriKind.Relative));

                grabCursor     = new Cursor(grabStream.Stream);
                grabbingCursor = new Cursor(grabbingStream.Stream);
            }
            catch //the designer view doesn't like this but it works at runtime
            {
                grabCursor = grabbingCursor = Cursors.Arrow;
            }
        }
        static FlyoutPaneWindow()
        {
            //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
            //This style is defined in themes\generic.xaml
            DefaultStyleKeyProperty.OverrideMetadata(typeof(FlyoutPaneWindow),
                                                     new FrameworkPropertyMetadata(typeof(FlyoutPaneWindow)));

            //AllowsTransparency slow down perfomance under XP/VISTA because rendering is enterely perfomed using CPU
            //Window.AllowsTransparencyProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(true));

            WindowStyleProperty.OverrideMetadata(typeof(FlyoutPaneWindow),
                                                 new FrameworkPropertyMetadata(WindowStyle.None));
            ShowInTaskbarProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(false));
            ResizeModeProperty.OverrideMetadata(typeof(FlyoutPaneWindow),
                                                new FrameworkPropertyMetadata(ResizeMode.NoResize));
            BackgroundProperty.OverrideMetadata(typeof(FlyoutPaneWindow),
                                                new FrameworkPropertyMetadata(Brushes.Transparent));
        }
示例#6
0
        static JumpTopAppBar()
        {
            DefaultStyleKeyProperty
            .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(typeof(JumpTopAppBar)));
            BackgroundProperty
            .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(Brushes.Transparent));
            HeightProperty
            .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(Convert.ToDouble(40)));
            HorizontalAlignmentProperty
            .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch));
            VerticalAlignmentProperty
            .OverrideMetadata(typeof(JumpTopAppBar), new FrameworkPropertyMetadata(VerticalAlignment.Top));

            /////////////////////////////////////////////////////////////////////////////////
            /// Routed Events:
            /////////////////////////////////////////////////////////////////////////////////
            EventManager.RegisterClassHandler(typeof(JumpTopAppBar), SizeChangedEvent, new RoutedEventHandler(OnLoaded));
        }
示例#7
0
        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();
        }
示例#8
0
        /// <summary>
        /// 静的コンストラクタ
        /// </summary>
        static DecoratedText()
        {
            var depenencyPropertyList = new DependencyProperty[]
            {
                FontFamilyProperty,
                FontStyleProperty,
                FontWeightProperty,
                FontStretchProperty,
                FontSizeProperty,
                StrokeProperty,
                StrokeThicknessProperty,

                FlowDirectionProperty,
                ForegroundProperty,
                HorizontalContentAlignmentProperty,
                VerticalContentAlignmentProperty,

                MaxWidthProperty,
                MaxHeightProperty,
            };

            // 依存関係にあるプロパティが変更されたら、
            // コンテンツの内容を更新します。
            foreach (var property in depenencyPropertyList)
            {
                property.OverrideMetadata(
                    typeof(DecoratedText),
                    new FrameworkPropertyMetadata(OnPropertyChanged));
            }

            DefaultStyleKeyProperty.OverrideMetadata(
                typeof(DecoratedText),
                new FrameworkPropertyMetadata(typeof(DecoratedText)));
            BackgroundProperty.OverrideMetadata(
                typeof(DecoratedText),
                new FrameworkPropertyMetadata(
                    Brushes.Transparent, OnPropertyChanged));
        }
        static AppointmentItem()
        {
            BackgroundProperty.OverrideMetadata(typeof(AppointmentItem), new FrameworkPropertyMetadata((Brush)null, FrameworkPropertyMetadataOptions.AffectsRender));

            fillBrushHover = new SolidColorBrush(Colors.White);
            fillBrushHover.Freeze();

            fillBrush = new SolidColorBrush(Colors.Orange);
            fillBrush.Freeze();

            borderBrush = new SolidColorBrush(Colors.Black);
            borderBrush.Freeze();

            pen = new Pen(borderBrush, 1);
            pen.Freeze();

            style = new Style(typeof(AppointmentItem));
            style.Setters.Add(new Setter()
            {
                Property = BackgroundProperty,
                Value    = fillBrush,
            });

            Trigger trigger = new Trigger()
            {
                Property = IsMouseOverProperty,
                Value    = true
            };

            trigger.Setters.Add(new Setter()
            {
                Property = BackgroundProperty,
                Value    = Brushes.Red
            });

            style.Triggers.Add(trigger);
        }
示例#10
0
        static InfoCardWindow()
        {
            ShowInTaskbarProperty.OverrideMetadata(
                typeof(InfoCardWindow),
                new FrameworkPropertyMetadata(false));

            SizeToContentProperty.OverrideMetadata(
                typeof(InfoCardWindow),
                new FrameworkPropertyMetadata(SizeToContent.WidthAndHeight));

            WindowStyleProperty.OverrideMetadata(
                typeof(InfoCardWindow),
                new FrameworkPropertyMetadata(WindowStyle.None));

            ResizeModeProperty.OverrideMetadata(
                typeof(InfoCardWindow),
                new FrameworkPropertyMetadata(ResizeMode.NoResize));

            AllowsTransparencyProperty.OverrideMetadata(
                typeof(InfoCardWindow),
                new FrameworkPropertyMetadata(true));

            BackgroundProperty.OverrideMetadata(
                typeof(InfoCardWindow),
                new FrameworkPropertyMetadata(Brushes.Transparent));

            EventManager.RegisterClassHandler(
                typeof(InfoCard),
                InfoCard.PinnedEvent,
                (RoutedEventHandler)OnInfoCardPinned);

            EventManager.RegisterClassHandler(
                typeof(InfoCard),
                InfoCard.UnpinnedEvent,
                (RoutedEventHandler)OnInfoCardUnpinned);
        }
示例#11
0
 static ItemView()
 {
     IconVisibilityProperty = DependencyProperty.Register(nameof(IconVisibility), typeof(Visibility), typeof(ItemView), new FrameworkPropertyMetadata()
     {
         PropertyChangedCallback = (o, e) =>
         {
             ((ItemView)o).iconView.Visibility = (Visibility)e.NewValue;
         }
     });
     IconProperty = DependencyProperty.Register(nameof(Icon), typeof(Icon), typeof(ItemView), new FrameworkPropertyMetadata()
     {
         PropertyChangedCallback = (o, e) =>
         {
             ((ItemView)o).iconView.Icon = (Icon)e.NewValue;
         }
     });
     ContentProperty = DependencyProperty.Register(nameof(Content), typeof(object), typeof(ItemView), new FrameworkPropertyMetadata()
     {
         PropertyChangedCallback = (o, e) =>
         {
             var newVal = e.NewValue;
             if (newVal is string)
             {
                 newVal = newVal.ToString().Replace("_", "__"); // Сrutch for "mnemonic key using"
             }
             ((ItemView)o).label.Content = newVal;
         }
     });
     SelectableProperty = DependencyProperty.Register(nameof(Selectable), typeof(bool), typeof(ItemView), new FrameworkPropertyMetadata()
     {
         PropertyChangedCallback = (o, e) =>
         {
             var itemView = ((ItemView)o);
             if (!(bool)e.NewValue)
             {
                 itemView.Selected = false;
             }
         }
     });
     SelectedProperty = DependencyProperty.Register(nameof(Selected), typeof(bool), typeof(ItemView), new FrameworkPropertyMetadata()
     {
         PropertyChangedCallback = (o, e) =>
         {
             var itemView = ((ItemView)o);
             if (itemView.Selectable)
             {
                 var value = (bool)e.NewValue;
                 itemView.backView.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
                 itemView.SelectionChanged?.Invoke(o, new SelectionChangedEventArgs()
                 {
                     Item     = itemView,
                     Selected = value
                 });
             }
             else
             {
                 itemView.Selected = false;
             }
         }
     });
     IconVerticalAligmentProperty = DependencyProperty.Register(nameof(IconVerticalAligment), typeof(VerticalAlignment), typeof(ItemView), new FrameworkPropertyMetadata()
     {
         PropertyChangedCallback = (o, e) =>
         {
             var itemView = ((ItemView)o);
             var value    = (VerticalAlignment)e.NewValue;
             itemView.iconView.VerticalAlignment = value;
         }
     });
     IconHorizontalAligmentProperty = DependencyProperty.Register(nameof(IconHorizontalAligment), typeof(HorizontalAlignment), typeof(ItemView), new FrameworkPropertyMetadata(HorizontalAlignment.Left)
     {
         PropertyChangedCallback = (o, e) =>
         {
             var itemView = ((ItemView)o);
             var value    = (HorizontalAlignment)e.NewValue;
             itemView.iconView.HorizontalAlignment = value;
         }
     });
     CommandProperty = DependencyProperty.Register(nameof(Command), typeof(ICommand), typeof(ItemView), new FrameworkPropertyMetadata()
     {
         PropertyChangedCallback = (o, e) =>
         {
             var itemView            = ((ItemView)o);
             var value               = (ICommand)e.NewValue;
             itemView.button.Command = value;
         }
     });
     BackgroundProperty.OverrideMetadata(typeof(ItemView), new FrameworkPropertyMetadata(Visual.ItemBackground)
     {
         PropertyChangedCallback = (o, e) =>
         {
             var element        = ((UserControl)o);
             element.Background = (Brush)e.NewValue;
         }
     });
     SelectionBrushProperty = DependencyProperty.Register(nameof(SelectionBrush), typeof(Brush), typeof(ItemView), new FrameworkPropertyMetadata(Visual.ItemSelection)
     {
         PropertyChangedCallback = (o, e) =>
         {
             var element = (ItemView)o;
             element.backView.Background = (Brush)e.NewValue;
         }
     });
 }
示例#12
0
 static UnablePanel()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(UnablePanel), new FrameworkPropertyMetadata(typeof(UnablePanel)));
     BackgroundProperty.OverrideMetadata(typeof(UnablePanel), new FrameworkPropertyMetadata(Brushes.Transparent));
     CursorProperty.OverrideMetadata(typeof(UnablePanel), new FrameworkPropertyMetadata(Cursors.No));
 }
示例#13
0
 /// <summary>
 /// Initializes static members of the <see cref="Series" /> class.
 /// </summary>
 static Series()
 {
     VisibilityProperty.OverrideMetadata(typeof(Series), new PropertyMetadata(Visibility.Visible, AppearanceChanged));
     BackgroundProperty.OverrideMetadata(typeof(Series), new FrameworkPropertyMetadata(null, AppearanceChanged));
 }
示例#14
0
 /// <summary>
 /// Overrides metadata of an existing DependencyProperty element and specifies the default style key for this class.
 /// </summary>
 static Gauge()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(Gauge), new FrameworkPropertyMetadata(typeof(Gauge)));
     BackgroundProperty.OverrideMetadata(typeof(Gauge), new FrameworkPropertyMetadata(Brushes.Black));
 }
 static MapBase()
 {
     ClipToBoundsProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(true));
     BackgroundProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(Brushes.Transparent));
 }
示例#16
0
        static HtmlPanel()
        {
            BackgroundProperty.OverrideMetadata(typeof(HtmlPanel), new FrameworkPropertyMetadata(SystemColors.WindowBrush));

            TextProperty.OverrideMetadata(typeof(HtmlPanel), new PropertyMetadata(null, OnTextProperty_change));
        }
 static HyperlinkTextBoxView()
 {
     BackgroundProperty.OverrideMetadata(typeof(HyperlinkTextBoxView), new FrameworkPropertyMetadata(Brushes.White, backgroundChanged));
 }
示例#18
0
 static CustomWindow()
 {
     BackgroundProperty.OverrideMetadata(typeof(CustomWindow), new FrameworkPropertyMetadata(Brushes.White));
     BorderBrushProperty.OverrideMetadata(typeof(CustomWindow), new FrameworkPropertyMetadata(new SolidColorBrush(Color.FromRgb(103, 163, 219))));
     DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomWindow), new FrameworkPropertyMetadata(typeof(CustomWindow)));
 }
示例#19
0
 static ShipLevelChart()
 {
     BackgroundProperty.OverrideMetadata(typeof(ShipLevelChart), new FrameworkPropertyMetadata(ParamsChanges));
     ForegroundProperty.OverrideMetadata(typeof(ShipLevelChart), new FrameworkPropertyMetadata(ParamsChanges));
 }
示例#20
0
 static LayoutDragSplitter()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutDragSplitter), new FrameworkPropertyMetadata(typeof(LayoutDragSplitter)));
     BackgroundProperty.OverrideMetadata(typeof(LayoutDragSplitter), new FrameworkPropertyMetadata(Brushes.Transparent));
     IsHitTestVisibleProperty.OverrideMetadata(typeof(LayoutDragSplitter), new FrameworkPropertyMetadata(true, null));
 }
示例#21
0
 static MarketLoading()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(MarketLoading), new FrameworkPropertyMetadata(typeof(MarketLoading)));
     ClipToBoundsProperty.OverrideMetadata(typeof(MarketLoading), new FrameworkPropertyMetadata(false));
     BackgroundProperty.OverrideMetadata(typeof(MarketLoading), new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Transparent)));
 }
示例#22
0
 static IntegerSpinner()
 {
     BackgroundProperty.OverrideMetadata(typeof(IntegerSpinner), new FrameworkPropertyMetadata(new PropertyChangedCallback(BackgroundPropertyChanged)));
 }
示例#23
0
 static Page()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(Page), new FrameworkPropertyMetadata(typeof(Page)));
     BackgroundProperty.OverrideMetadata(typeof(Page), new FrameworkPropertyMetadata(Brushes.Transparent));
     FontSizeProperty.OverrideMetadata(typeof(Page), new FrameworkPropertyMetadata(14d));
 }
示例#24
0
 static SeekBar()
 {
     BackgroundProperty.OverrideMetadata(typeof(SeekBar), new FrameworkPropertyMetadata(Brushes.Black));
 }
示例#25
0
 /// <summary>
 /// Init.
 /// </summary>
 static HtmlLabel()
 {
     BackgroundProperty.OverrideMetadata(typeof(HtmlLabel), new FrameworkPropertyMetadata(Brushes.Transparent));
 }
示例#26
0
 static SeekBar()
 {
     BackgroundProperty.OverrideMetadata(typeof(SeekBar),
                                         new FrameworkPropertyMetadata(Brushes.Black, FrameworkPropertyMetadataOptions.AffectsRender));
 }
示例#27
0
 static Modal()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(Modal), new FrameworkPropertyMetadata(typeof(Modal)));
     BackgroundProperty.OverrideMetadata(typeof(Modal), new FrameworkPropertyMetadata(CreateDefaultBackground()));
 }
示例#28
0
        static PathButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(PathButton), new FrameworkPropertyMetadata(typeof(PathButton)));

            BackgroundProperty.OverrideMetadata(typeof(PathButton), new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Transparent)));
        }
示例#29
0
 static Trapezoid()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(Trapezoid), new FrameworkPropertyMetadata(typeof(Trapezoid)));
     BackgroundProperty.OverrideMetadata(typeof(Trapezoid), new FrameworkPropertyMetadata(Panel.BackgroundProperty.DefaultMetadata.DefaultValue,
                                                                                          FrameworkPropertyMetadataOptions.AffectsRender));
 }
示例#30
0
 static QuestionItemBox()
 {
     BackgroundProperty.OverrideMetadata(typeof(QuestionItemBox), new FrameworkPropertyMetadata(defaultBackgroundBrush));
     BorderBrushProperty.OverrideMetadata(typeof(QuestionItemBox), new FrameworkPropertyMetadata(defaultBorderBrush));
 }