How to change RelativePanel properties in Windows applications?

I tried to change the associated RelativePanel properties of the control using XAML in VisualState.Setters in a visual state, but the properties do not change, so I created a dependency property to check against the code and neither one nor the other.

Is there a way to update a new group of values, for example:

<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 to make the performance more responsive?

+6
source share
1 answer

To change the Attached Properties values ​​in Setter.Target use this format:

 TargetObjectXName.(ClassName.AttachedPropertyName) 

In your 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 x: the name of the control you want to place to the left of TimestablesControl.

+8
source

Source: https://habr.com/ru/post/984376/


All Articles