Example #1
0
 static MapPath()
 {
     StretchProperty.OverrideMetadata(typeof(MapPath),
                                      new FrameworkPropertyMetadata {
         CoerceValueCallback = (o, v) => Stretch.None
     });
 }
Example #2
0
 static PrimitiveShape()
 {
     StretchProperty.OverrideMetadata(typeof(PrimitiveShape),
                                      new DrawingPropertyMetadata(Stretch.Fill, DrawingPropertyMetadataOptions.AffectsRender));
     StrokeThicknessProperty.OverrideMetadata(typeof(PrimitiveShape),
                                              new DrawingPropertyMetadata(ValueBoxes.Double1Box, DrawingPropertyMetadataOptions.AffectsRender));
 }
Example #3
0
        static MediaElement()
        {
            Style style = CreateDefaultStyles();

            StyleProperty.OverrideMetadata(typeof(MediaElement), new FrameworkPropertyMetadata(style));

            //
            // The Stretch & StretchDirection properties are AddOwner'ed from a class which is not
            // base class for MediaElement so the metadata with flags get lost. We need to override them
            // here to make it work again.
            //
            StretchProperty.OverrideMetadata(
                typeof(MediaElement),
                new FrameworkPropertyMetadata(
                    Stretch.Uniform,
                    FrameworkPropertyMetadataOptions.AffectsMeasure
                    )
                );

            StretchDirectionProperty.OverrideMetadata(
                typeof(MediaElement),
                new FrameworkPropertyMetadata(
                    StretchDirection.Both,
                    FrameworkPropertyMetadataOptions.AffectsMeasure
                    )
                );
        }
Example #4
0
 static RingShape()
 {
     StretchProperty.OverrideMetadata(
         typeof(RingShape),
         new FrameworkPropertyMetadata(
             Stretch.Uniform,
             FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender)
         );
 }
Example #5
0
        static ButtonImage()
        {
            DefaultStyleKeyProperty.OverrideMetadata(
                typeof(ButtonImage),
                new FrameworkPropertyMetadata(typeof(ButtonImage)));

            StretchProperty.OverrideMetadata(typeof(ButtonImage),
                                             new FrameworkPropertyMetadata(System.Windows.Media.Stretch.Uniform));
        }
Example #6
0
        static AppIconImage()
        {
            StretchProperty.OverrideMetadata(typeof(AppIconImage), new FrameworkPropertyMetadata(Stretch.Uniform));
            SourceProperty.OverrideMetadata(typeof(AppIconImage), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(SourceChanged), new CoerceValueCallback(SourceCoerceCallback)));

            string exePath = GetExePath();

            __appSmallIcon = IconReader.GetFileIcon(exePath, IconReader.IconSize.Small, false);
            //__appLargeIcon = IconReader.GetFileIcon(exePath, IconReader.IconSize.Large, false);
        }
Example #7
0
        static MenuItemImage()
        {
            DefaultStyleKeyProperty.OverrideMetadata(
                typeof(MenuItemImage),
                new FrameworkPropertyMetadata(typeof(MenuItemImage)));

            StretchProperty.OverrideMetadata(typeof(MenuItemImage),
                                             new FrameworkPropertyMetadata(System.Windows.Media.Stretch.Uniform));

            MaxWidthProperty.OverrideMetadata(typeof(MenuItemImage), new FrameworkPropertyMetadata(16d));
            MaxHeightProperty.OverrideMetadata(typeof(MenuItemImage), new FrameworkPropertyMetadata(16d));
        }
Example #8
0
 static Polyline()
 {
     StretchProperty.OverrideMetadata(typeof(Polyline), new PropertyMetadata(Stretch.Fill, Stretch_Changed));
 }
 static BaseD3D9DrawingSurface()
 {
     StretchProperty.OverrideMetadata(typeof(BaseD3D9DrawingSurface), new FrameworkPropertyMetadata(Stretch.Fill));
     FocusableProperty.OverrideMetadata(typeof(BaseD3D9DrawingSurface), new FrameworkPropertyMetadata(true));
 }
Example #10
0
 /// <summary>
 ///
 /// </summary>
 static DPFCanvas()
 {
     StretchProperty.OverrideMetadata(typeof(DPFCanvas), new FrameworkPropertyMetadata(Stretch.Fill));
 }
 static BalloonBase()
 {
     StretchProperty.OverrideMetadata(typeof(BalloonBase), new FrameworkPropertyMetadata(Stretch.Fill));
 }
Example #12
0
 static Rectangle()
 {
     StretchProperty.OverrideMetadata(typeof(Rectangle), new FrameworkPropertyMetadata(defaultValue: Media.Stretch.Fill));
 }
Example #13
0
 static DrawingSurface()
 {
     StretchProperty.OverrideMetadata(typeof(DrawingSurface), new FrameworkPropertyMetadata(Stretch.Fill));
 }
Example #14
0
 static Ellipse()
 {
     StretchProperty.OverrideMetadata(typeof(Ellipse), new FrameworkPropertyMetadata(defaultValue: Media.Stretch.Fill));
 }
Example #15
0
 static Sprite()
 {
     StretchProperty.OverrideMetadata(typeof(Sprite), new FrameworkPropertyMetadata(Stretch.Fill));
     WidthProperty.OverrideMetadata(typeof(Sprite), new FrameworkPropertyMetadata(1));
     HeightProperty.OverrideMetadata(typeof(Sprite), new FrameworkPropertyMetadata(1));
 }
        /// <summary>
        /// Get the dependency property tests.
        /// </summary>
        /// <returns>The dependency property tests.</returns>
        public override IEnumerable <DependencyPropertyTestMethod> GetDependencyPropertyTests()
        {
            IList <DependencyPropertyTestMethod> tests = TagInherited(base.GetDependencyPropertyTests());

            // Remove tests inherited from ControlTest that require setting template
            // because Viewbox doesn't allow template to be redefined.
            tests.RemoveTests(BackgroundProperty.TemplateBindTest);
            tests.RemoveTests(BorderBrushProperty.TemplateBindTest);
            tests.RemoveTests(BorderThicknessProperty.TemplateBindTest);
            tests.RemoveTests(FontFamilyProperty.TemplateBindTest);
            tests.RemoveTests(FontSizeProperty.TemplateBindTest);
            tests.RemoveTests(FontStretchProperty.TemplateBindTest);
            tests.RemoveTests(FontStyleProperty.TemplateBindTest);
            tests.RemoveTests(FontWeightProperty.TemplateBindTest);
            tests.RemoveTests(ForegroundProperty.TemplateBindTest);
            tests.RemoveTests(HorizontalAlignmentProperty.TemplateBindTest);
            tests.RemoveTests(HorizontalContentAlignmentProperty.TemplateBindTest);
            tests.RemoveTests(IsEnabledProperty.TemplateBindTest);
            tests.RemoveTests(PaddingProperty.TemplateBindTest);
            tests.RemoveTests(VerticalAlignmentProperty.TemplateBindTest);
            tests.RemoveTests(VerticalContentAlignmentProperty.TemplateBindTest);

            // Remove other DP tests for properties inherited from Control
            // but don't exist in WPF's Viewbox?
            //   BorderThickness, BorderBrush, Background, Foreground
            //   FontFamily, FontSize, FontStretch, FontStyle, FontWeight
            //   IsTabStop, Padding, TabIndex, Template
            //   HorizontalContentAlignment, VerticalContentAlignment
            tests.RemoveTests(HorizontalContentAlignmentProperty.CheckDefaultValueTest);
            tests.RemoveTests(HorizontalContentAlignmentProperty.ClearValueResetsDefaultTest);
            tests.RemoveTests(VerticalContentAlignmentProperty.CheckDefaultValueTest);
            tests.RemoveTests(VerticalContentAlignmentProperty.ClearValueResetsDefaultTest);

            // StretchProperty tests
            tests.Add(StretchProperty.CheckDefaultValueTest);
            tests.Add(StretchProperty.ChangeClrSetterTest);
            tests.Add(StretchProperty.ChangeSetValueTest);
            tests.Add(StretchProperty.ClearValueResetsDefaultTest);
            tests.Add(StretchProperty.InvalidValueFailsTest);
            tests.Add(StretchProperty.InvalidValueIsIgnoredTest);
            tests.Add(StretchProperty.CanBeStyledTest);
            ////tests.Add(StretchProperty.TemplateBindTest);
            tests.Add(StretchProperty.DoesNotChangeVisualStateTest(Stretch.None, Stretch.Fill));
            tests.Add(StretchProperty.DoesNotChangeVisualStateTest(Stretch.Fill, Stretch.Uniform));
            tests.Add(StretchProperty.DoesNotChangeVisualStateTest(Stretch.Uniform, Stretch.UniformToFill));
            tests.Add(StretchProperty.DoesNotChangeVisualStateTest(Stretch.UniformToFill, Stretch.None));
            tests.Add(StretchProperty.SetXamlAttributeTest);
            tests.Add(StretchProperty.SetXamlElementTest);

            // StretchDirectionProperty tests
            tests.Add(StretchDirectionProperty.CheckDefaultValueTest);
            tests.Add(StretchDirectionProperty.ChangeClrSetterTest);
            tests.Add(StretchDirectionProperty.ChangeSetValueTest);
            tests.Add(StretchDirectionProperty.ClearValueResetsDefaultTest);
            tests.Add(StretchDirectionProperty.InvalidValueFailsTest);
            tests.Add(StretchDirectionProperty.InvalidValueIsIgnoredTest);
            tests.Add(StretchDirectionProperty.CanBeStyledTest);
            ////tests.Add(StretchDirectionProperty.TemplateBindTest);
            tests.Add(StretchDirectionProperty.DoesNotChangeVisualStateTest(StretchDirection.DownOnly, StretchDirection.UpOnly));
            tests.Add(StretchDirectionProperty.DoesNotChangeVisualStateTest(StretchDirection.UpOnly, StretchDirection.Both));
            tests.Add(StretchDirectionProperty.DoesNotChangeVisualStateTest(StretchDirection.Both, StretchDirection.DownOnly));
            tests.Add(StretchDirectionProperty.SetXamlAttributeTest);
            tests.Add(StretchDirectionProperty.SetXamlElementTest);

            return(tests);
        }
Example #17
0
 set => SetValue(StretchProperty, value);
Example #18
0
 // The default stretch mode of Ellipse is Fill
 static Ellipse()
 {
     StretchProperty.OverrideMetadata(typeof(Ellipse), new FrameworkPropertyMetadata(Stretch.Fill));
 }
Example #19
0
File: Arc.cs Project: hirekoke/Arc
 static Arc()
 {
     StretchProperty.OverrideMetadata(typeof(Arc), new FrameworkPropertyMetadata(Stretch.Fill));
 }
 // The default stretch mode of Rectangle is Fill
 static Rectangle()
 {
     StretchProperty.OverrideMetadata(typeof(Rectangle), new FrameworkPropertyMetadata(Stretch.Fill));
 }
 static DashedSeparator()
 {
     StretchProperty.OverrideMetadata(typeof(DashedSeparator), new FrameworkPropertyMetadata(Stretch.Fill));
     StrokeProperty.OverrideMetadata(typeof(DashedSeparator), new FrameworkPropertyMetadata(OnPenChanged));
     StrokeThicknessProperty.OverrideMetadata(typeof(DashedSeparator), new FrameworkPropertyMetadata(OnPenChanged));
 }