I found the problem, in default my VS defines Rectagle as ...Drawing.Rectangle.
I forced VS to define Rectangle as shape using code:
Windows.UI.Xaml.Shapes.Rectangle rect = (Windows.UI.Xaml.Shapes.Rectangle)asType;
[UWP] How to convert DependencyObject on the Rectangle
BitSmithy
1,751
Reputation points
I cant convert DependencyObject to Rectangle object
DependencyObject asType;
Rectangle rect = (Rectangle)asType;
Intelisense tells if it is impossible, but In documentation Rectangle inherrites from DepenencyObject
Inheritance: DependencyObject>UIElement>FrameworkElement>Shape>Rectangle
Is it possible to cast DependencyObject on Rectangle?
Accepted answer
-
BitSmithy 1,751 Reputation points
2020-03-22T22:56:33+00:00
2 additional answers
Sort by: Most helpful
-
Peter Fleischer (former MVP) 19,231 Reputation points
2020-03-22T15:39:43.353+00:00 Hi, see documentation for Rectangle in System.Drawing:
Inheritance > Object > ValueType > Rectangle
-
Javier R 211 Reputation points
2020-03-23T09:50:13.737+00:00 hello:
Windows.UI.Xaml.Shapes.Rectangle rect = new Windows.UI.Xaml.Shapes.Rectangle();