0
我有一個複合XAML控件。它看起來像這樣:當一個複合XAML控件被選中時,如何確保整個父控件是可見的?
<UI:CompoundControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Dynamics="clr-namespace:MyNamespace.UI" Height="Auto" >
<Stackpanel Orietnation="Vertical">
<TextArea x:Name="lblTop" DockPanel.Dock="Left">Label</TextArea >
<TextArea x:Name="lblBottom" DockPanel.Dock="Left">Label</TextArea >
</Stackpanel >
</UI:CompoundControl>
當應用程序運行,在這CompoundControl
s的UIElementCollection,這顯示他們在一個滾動列表。
當我按選項卡鍵時,應用程序將焦點依次移動到下一個TextArea,滾動視圖以進行操作。但是,它只滾動顯示集中控制,所以我遇到了一個問題,其中按標籤並不顯示CompoundControl
的全部,只有上半部分。
是否有一些屬性,我可以設置,使自動滾動顯示整個控制,而不是簡單的上半部分?
將ScrollViewer的「CanContentScroll」屬性設置爲true – netaholic