6

I have tried to change the RelativePanel attached properties of a control by XAML in the VisualState.Setters in a Visual State but the properties do not change, so I created a dependency property to test by code behind and neither.

Is there any way to refresh to a new group of values like:

 <VisualState.Setters>
      <Setter Target="TimestablesControl.RelativePanel.RightOf" Value=""/>
      <Setter Target="TimestablesControl.RelativePanel.AlignRightWithPanel" Value="false"/>
      <Setter Target="TimestablesControl.RelativePanel.AlignLeftWithPanel" Value="true"/> 
 </VisualState.Setters>

And make the view more 'responsive'?

Filip Skakun
  • 31,624
  • 6
  • 74
  • 100
Juan Pablo Garcia Coello
  • 3,192
  • 1
  • 23
  • 33

1 Answers1

8

For changing values of Attached Properties in Setter.Target use this format:

TargetObjectXName.(ClassName.AttachedPropertyName)

In you case:

 <VisualState.Setters>
      <Setter Target="TimestablesControl.(RelativePanel.RightOf)" Value="Control1"/>
      <Setter Target="TimestablesControl.(RelativePanel.AlignRightWithPanel)" Value="False"/>
      <Setter Target="TimestablesControl.(RelativePanel.AlignLeftWithPanel)" Value="True"/> 
 </VisualState.Setters>

Where "Control1" is the x:Name of the control you want to place left of TimestablesControl.

Martin Suchan
  • 10,600
  • 3
  • 36
  • 66