0

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

到目前为止,我尝试了 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

4

1 回答 1

1

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

编辑:增量未更改

于 2011-09-15T12:39:14.763 回答