【发布时间】:2009-06-29 21:32:05
【问题描述】:
我是 XAML 的新手,所以请注意我的问题可能包含一些主题误解。
是否可以绑定 XAML 用户控件全局(相对于窗口)位置以检查它当前是否在屏幕上可见?用户控件插入到 ScrollViewer 中,我认为是这样的:
<UserControl x:Class="Test.MessageControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="300">
<StackPanel >
<Label Name="LabelTest"
Content="{Binding RelativeSource={RelativeSource Self},
Path=MAGIC-GOES-HERE-Location.Y }" />
</StackPanel>
</UserControl>
【问题讨论】:
标签: xaml user-controls