我有一堆兒童在其中的相對面板。我想通過VisualStates中的AdoptiveTrigger來改變兒童的位置。 問題是,當我想要從其他元素的下方更改元素位置到該元素的右側時,我必須刪除Below Attached Property的值,然後設置RightOf屬性以使其工作,否則會使應用程序崩潰。 現在我想現在如何刪除下面的值? 我試圖 a.reset在每個狀態的屬性窗口中的綁定,然後分配我的值 b.setting該值爲空字符串,如「」; c。忽略該屬性。 這些都沒有工作! 請幫幫我!通過VisualStates在RelativePanel中重新定位兒童
0
A
回答
0
你可以做
<Setter Target="SomeElement.(RelativePanel.Below)" Value="{x:Null}" />
2
設置附加屬性RelativePanel.Below
空可以工作。除此之外,我們還可以通過設置AlignTopWith
或AlignVerticalCenterWith
屬性來解決此問題。
這是可行的,因爲AlignTopWith
的優先級高於Below
,對於AlignVerticalCenterWith
屬性,如果沒有衝突,則應用該屬性。作爲我的測試,AlignVerticalCenterWith
的優先級也高於Below
。
欲瞭解更多信息,請參閱RelativePanel
類中的Conflicting relationships部分。
以下是我用來測試的樣品:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="600" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="BlueRect.(RelativePanel.Below)" Value="" />
<Setter Target="GreenRect.(RelativePanel.RightOf)" Value="BlueRect" />
<Setter Target="GreenRect.(RelativePanel.Below)" Value="RedRect" />
<!--<Setter Target="GreenRect.(RelativePanel.AlignVerticalCenterWith)" Value="BlueRect" />-->
<!--<Setter Target="GreenRect.(RelativePanel.AlignTopWith)" Value="BlueRect" />-->
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<RelativePanel>
<Rectangle x:Name="RedRect"
Width="100"
Height="100"
Fill="Red" />
<Rectangle x:Name="BlueRect"
Width="100"
Height="200"
Fill="Blue"
RelativePanel.Below="RedRect"
RelativePanel.RightOf="RedRect" />
<Rectangle x:Name="GreenRect"
Width="100"
Height="100"
Fill="Green"
RelativePanel.Below="BlueRect"
RelativePanel.RightOf="RedRect" />
</RelativePanel>
</Grid>
+0
TNX,似乎它的工作原理,我會檢查它,但現在我已經提交了我的應用程序存儲幾個小時前:( –
相關問題
- 1. JQuery定位兒童
- 2. 通過兒童叉
- 3. Flexbox重疊絕對定位兒童
- 4. 兒童SkShapeNode定位混亂
- 5. 循環通過兒童
- 6. ActiveRecord:通過循環收集來重新分配兒童失敗
- 7. 重定向過時的類別和兒童產品通過301重定向
- 8. 兒童通信
- 9. 通過StackPanel的兒童在WPF
- 10. 在windows phone 7畫布中添加兒童超過兒童
- 11. 在sitecore中獲取兒童兒童
- 12. 定製兒童
- 13. 在W10創作者更新後,UWP MapControl兒童不再定位
- 14. 重新排序StackPanel的兒童拖放
- 15. 定位的UIViewController遏制兒童
- 16. 絕對定位兒童填充高度
- 17. 主營兒童分區定位
- 18. 相對定位兒童的容器
- 19. jQuery未能定位到兒童
- 20. Angular2:我如何定位到兒童component.ts
- 21. 自定義位置(兒童)由座標
- 22. 的絕對定位的兒童
- 23. jQuery的:通過這項兒童功能
- 24. 流星1.2通過@Index兒童模板
- 25. 通過兒童div的jQuery循環
- 26. jsTree通過ajax加載兒童
- 27. 通過HQL獲得兒童數量
- 28. 在Expandable中重複兒童listView android
- 29. 在兒童表中重複的ID
- 30. 兒童內部角兒童
這給了我這個消息:災難性故障(Exeption fromHRESULT 0x8000FFFF(E_UNEXPECTED)) –