@@ -25,21 +25,12 @@ public Brush()
25
25
26
26
public double Opacity
27
27
{
28
- get => ( double ) GetValue ( OpacityProperty ) ;
29
- set => SetValue ( OpacityProperty , value ) ;
28
+ get => GetOpacityValue ( ) ;
29
+ set => SetOpacityValue ( value ) ;
30
30
}
31
31
32
- // Using a DependencyProperty as the backing store for Opacity. This enables animation, styling, binding, etc...
33
- public static DependencyProperty OpacityProperty { get ; } =
34
- DependencyProperty . Register (
35
- "Opacity" ,
36
- typeof ( double ) ,
37
- typeof ( Brush ) ,
38
- new FrameworkPropertyMetadata (
39
- defaultValue : 1d ,
40
- propertyChangedCallback : ( s , e ) => ( ( Brush ) s ) . OnOpacityChanged ( ( double ) e . OldValue , ( double ) e . NewValue )
41
- )
42
- ) ;
32
+ [ GeneratedDependencyProperty ( DefaultValue = 1d , ChangedCallback = true ) ]
33
+ public static DependencyProperty OpacityProperty { get ; } = CreateOpacityProperty ( ) ;
43
34
44
35
protected virtual void OnOpacityChanged ( double oldValue , double newValue )
45
36
{
@@ -60,20 +51,12 @@ public Windows.UI.Xaml.Media.Transform Transform
60
51
61
52
public Transform RelativeTransform
62
53
{
63
- get => ( Transform ) GetValue ( RelativeTransformProperty ) ;
64
- set => SetValue ( RelativeTransformProperty , value ) ;
54
+ get => GetRelativeTransformValue ( ) ;
55
+ set => SetRelativeTransformValue ( value ) ;
65
56
}
66
57
67
- public static DependencyProperty RelativeTransformProperty { get ; } =
68
- DependencyProperty . Register (
69
- "RelativeTransform" ,
70
- typeof ( Transform ) ,
71
- typeof ( Brush ) ,
72
- new FrameworkPropertyMetadata (
73
- null ,
74
-
75
- propertyChangedCallback : ( s , e ) =>
76
- ( ( Brush ) s ) . OnRelativeTransformChanged ( ( Transform ) e . OldValue , ( Transform ) e . NewValue ) ) ) ;
58
+ [ GeneratedDependencyProperty ( DefaultValue = null , ChangedCallback = true ) ]
59
+ public static DependencyProperty RelativeTransformProperty { get ; } = CreateRelativeTransformProperty ( ) ;
77
60
78
61
protected virtual void OnRelativeTransformChanged ( Transform oldValue , Transform newValue )
79
62
{
0 commit comments