Search code examples
c#graphicswindows-phone

How to set position(margin) of BlockArrow in windows phone via c#


As in the subject how to set position of BlockArrow in windows phone via c#.

I have tried:(indic is the name for instance of BlockArrow)

indic.SetValue(BlockArrow.MarginProperty, 500d); //no possibility to say which margin I meant here

and that:

indic.Margin.Left = 400d;

but it says:Cannot modify the return value of 'System.Windows.FrameworkElement.Margin' because it is not a variable


Solution

  • I think you have to do something like

    var margin = indic.Margin;
    margin.Left = 400d;
    indic.Margin = margin;