Jua*_*llo 6 xaml attached-properties win-universal-app windows-10 uwp-xaml
我试图在可视状态的VisualState.Setters中通过XAML更改控件的RelativePanel附加属性,但属性不会更改,因此我创建了一个依赖项属性,以便通过代码进行测试,两者都没有.
有没有办法刷新到一组新的值,如:
<VisualState.Setters>
<Setter Target="TimestablesControl.RelativePanel.RightOf" Value=""/>
<Setter Target="TimestablesControl.RelativePanel.AlignRightWithPanel" Value="false"/>
<Setter Target="TimestablesControl.RelativePanel.AlignLeftWithPanel" Value="true"/>
</VisualState.Setters>
Run Code Online (Sandbox Code Playgroud)
并使视图更"响应"?
要在Setter.Target中更改附加属性的值,请使用以下格式:
TargetObjectXName.(ClassName.AttachedPropertyName)
Run Code Online (Sandbox Code Playgroud)
在你的情况下:
<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>
Run Code Online (Sandbox Code Playgroud)
其中"Control1"是x:您想要放置在TimestablesControl左侧的控件的名称.
| 归档时间: |
|
| 查看次数: |
1063 次 |
| 最近记录: |