Surface SDK 中 ScatterViewItem 位置更改的事件处理程序?
有谁知道在 ScatterViewItem 失去动量并在屏幕上轻弹后停止时捕获 ScatterViewItem 位置(中心属性)的简单方法?我设置了一个“热点”区域,我想在该项目在其范围内停止时启动文件传输。
到目前为止,我已经尝试了 PropertyChanged 通知,但没有成功:
---OvelayWrapper.xaml.cs---
---------------------------
public event PropertyChangedEventHandler PropertyChanged;
public Point CurrentLocation
{
get
{
return _CurrentLocation;
}
set
{
_CurrentLocation = value;
OnPropertyChanged("CurrentLocation");
}
}
protected void OnPropertyChanged(string newLoc)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(newLoc));
}
Console.WriteLine("New Location Recorded");
}
---OverlayWrapper.xaml---
-------------------------
<s:ScatterViewItem Center="{Binding Path=CurrentLocation}">
<Label Content="Test" />
</s:ScatterViewItem>
ScatterViewItems 有一个 SizedChanged 事件处理程序,我用它来跟踪缩放,但是 TranslationChanged 事件处理程序不存在是没有意义的。
另外,我无法使用 ScatterViewItem 的 ManipulationStarting/Delta/Completed 事件。
提前谢谢,
-Z
Does anyone know of an easy way to capture a ScatterViewItem's position (Center property) once it loses momentum and comes to a stop after being flicked across the screen? I have a "hotspot" area set up that I'd like to initiate a file transfer from once the item comes to a stop within its bounds.
So far I've tried a PropertyChanged Notification with no success:
---OvelayWrapper.xaml.cs---
---------------------------
public event PropertyChangedEventHandler PropertyChanged;
public Point CurrentLocation
{
get
{
return _CurrentLocation;
}
set
{
_CurrentLocation = value;
OnPropertyChanged("CurrentLocation");
}
}
protected void OnPropertyChanged(string newLoc)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(newLoc));
}
Console.WriteLine("New Location Recorded");
}
---OverlayWrapper.xaml---
-------------------------
<s:ScatterViewItem Center="{Binding Path=CurrentLocation}">
<Label Content="Test" />
</s:ScatterViewItem>
ScatterViewItems have a SizedChanged event handler that I use to track scaling with, but it doesn't make sense that a TranslationChanged event handler would not exist.
Also, I'm unable to make use of the ManipulationStarting/Delta/Completed events for a ScatterViewItem.
Thanks ahead of time,
-Z
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 ScatterManipulationDelta 进行位置、大小和旋转
编辑:增量未更改
Use ScatterManipulationDelta for position, size, and rotation
Edit: delta not changed