Question

I am trying to set the Margin of my Ellipse through code. How can I set the Margin of p?

auto p = ref new Windows::UI::Xaml::Shapes::Ellipse();
p->Height=100.0;
p->Width=100.0;
//p->Margin="36,19,0,0";
auto t = ref new Windows::UI::Xaml::Thickness(10.0,20.0,30.0,40.0);
Was it helpful?

Solution

Thickness is a value type, not a reference type, so it is not created with ref new.

p->Margin = Windows::UI::Xaml::Thickness(10.0, 20.0, 30.0, 40.0);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top