I’m facing this peculiar problem in my silverlight app. I have a Canvas that has a few Path elements. I need to load another UIElement on top of one of these Path elements. I have the code for it and it is all set.
The only problem I am facing is that I cannot update the Height and Width of these Path elements.
I was wondering if I could do something like this,
(Path) this.canvas_name.Children[index].Height = height_of_a_UIElement;
(Path) this.canvas_name.Children[index].Width = width_of_a_UIElement;
It seems like even though I cast it I cannot access these properties.
Could anyone please help me?
Thanks!
You are casting the
HeightandWidthproperties, instead of thePathobjects. Try this: