Surface SDK中ScatterViewItem位置更改的事件处理程序?

时间:2011-09-15 00:24:32

标签: c# wpf events scatterview

有人知道一个简单的方法来捕获ScatterViewItem的位置(中心属性)一旦它失去动力并在屏幕上轻弹后停止?我有一个“热点”区域设置,我希望在项目停止在其范围内时启动文件传输。

到目前为止,我已尝试过PropertyChanged Notification但没有成功:

    ---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

1 个答案:

答案 0 :(得分:1)

使用ScatterManipulationDelta进行位置,大小和旋转

编辑:delta未更改