@@ -54,101 +54,4 @@ public object[] ConvertBack(object value, Type[] targetTypes, object parameter,
54
54
}
55
55
}
56
56
57
- public class PartiallyRoundedRectangle : Shape
58
- {
59
- public static readonly DependencyProperty RadiusXProperty ;
60
- public static readonly DependencyProperty RadiusYProperty ;
61
-
62
- public static readonly DependencyProperty RoundTopLeftProperty ;
63
- public static readonly DependencyProperty RoundTopRightProperty ;
64
- public static readonly DependencyProperty RoundBottomLeftProperty ;
65
- public static readonly DependencyProperty RoundBottomRightProperty ;
66
-
67
- public int RadiusX
68
- {
69
- get { return ( int ) GetValue ( RadiusXProperty ) ; }
70
- set { SetValue ( RadiusXProperty , value ) ; }
71
- }
72
-
73
- public int RadiusY
74
- {
75
- get { return ( int ) GetValue ( RadiusYProperty ) ; }
76
- set { SetValue ( RadiusYProperty , value ) ; }
77
- }
78
-
79
- public bool RoundTopLeft
80
- {
81
- get { return ( bool ) GetValue ( RoundTopLeftProperty ) ; }
82
- set { SetValue ( RoundTopLeftProperty , value ) ; }
83
- }
84
-
85
- public bool RoundTopRight
86
- {
87
- get { return ( bool ) GetValue ( RoundTopRightProperty ) ; }
88
- set { SetValue ( RoundTopRightProperty , value ) ; }
89
- }
90
-
91
- public bool RoundBottomLeft
92
- {
93
- get { return ( bool ) GetValue ( RoundBottomLeftProperty ) ; }
94
- set { SetValue ( RoundBottomLeftProperty , value ) ; }
95
- }
96
-
97
- public bool RoundBottomRight
98
- {
99
- get { return ( bool ) GetValue ( RoundBottomRightProperty ) ; }
100
- set { SetValue ( RoundBottomRightProperty , value ) ; }
101
- }
102
-
103
- static PartiallyRoundedRectangle ( )
104
- {
105
- RadiusXProperty = DependencyProperty . Register
106
- ( "RadiusX" , typeof ( int ) , typeof ( PartiallyRoundedRectangle ) ) ;
107
- RadiusYProperty = DependencyProperty . Register
108
- ( "RadiusY" , typeof ( int ) , typeof ( PartiallyRoundedRectangle ) ) ;
109
-
110
- RoundTopLeftProperty = DependencyProperty . Register
111
- ( "RoundTopLeft" , typeof ( bool ) , typeof ( PartiallyRoundedRectangle ) ) ;
112
- RoundTopRightProperty = DependencyProperty . Register
113
- ( "RoundTopRight" , typeof ( bool ) , typeof ( PartiallyRoundedRectangle ) ) ;
114
- RoundBottomLeftProperty = DependencyProperty . Register
115
- ( "RoundBottomLeft" , typeof ( bool ) , typeof ( PartiallyRoundedRectangle ) ) ;
116
- RoundBottomRightProperty = DependencyProperty . Register
117
- ( "RoundBottomRight" , typeof ( bool ) , typeof ( PartiallyRoundedRectangle ) ) ;
118
- }
119
-
120
- public PartiallyRoundedRectangle ( )
121
- {
122
- }
123
-
124
- protected override Geometry DefiningGeometry
125
- {
126
- get
127
- {
128
- Geometry result = new RectangleGeometry
129
- ( new Rect ( 0 , 0 , base . Width , base . Height ) , RadiusX , RadiusY ) ;
130
- double halfWidth = base . Width / 2 ;
131
- double halfHeight = base . Height / 2 ;
132
-
133
- if ( ! RoundTopLeft )
134
- result = new CombinedGeometry
135
- ( GeometryCombineMode . Union , result , new RectangleGeometry
136
- ( new Rect ( 0 , 0 , halfWidth , halfHeight ) ) ) ;
137
- if ( ! RoundTopRight )
138
- result = new CombinedGeometry
139
- ( GeometryCombineMode . Union , result , new RectangleGeometry
140
- ( new Rect ( halfWidth , 0 , halfWidth , halfHeight ) ) ) ;
141
- if ( ! RoundBottomLeft )
142
- result = new CombinedGeometry
143
- ( GeometryCombineMode . Union , result , new RectangleGeometry
144
- ( new Rect ( 0 , halfHeight , halfWidth , halfHeight ) ) ) ;
145
- if ( ! RoundBottomRight )
146
- result = new CombinedGeometry
147
- ( GeometryCombineMode . Union , result , new RectangleGeometry
148
- ( new Rect ( halfWidth , halfHeight , halfWidth , halfHeight ) ) ) ;
149
-
150
- return result ;
151
- }
152
- }
153
- }
154
57
}
0 commit comments