【问题标题】:UserControl MouseButtonEventHandler Microsoft Surface ApplicationUserControl MouseButtonEventHandler Microsoft Surface 应用程序
【发布时间】:2011-10-01 20:21:00
【问题描述】:

我刚刚开始使用 Microsoft Surface。我在 Blend 4 中设计了一个UserControl。并在UserControl 上实现了一个简单的DrapDrop 事件。它工作正常。问题是,当我点击UserControl 时,UserControl 只是跳转到另一个位置。 对于拖放,我使用了这个代码 How to drag a UserControl inside a Canvas

唯一的设计区别是,我的UserControl 在网格内。在这个例子中,它是在一个 Canvas 中实现的。

【问题讨论】:

    标签: wpf user-controls pixelsense mouseleftbuttondown


    【解决方案1】:

    要在Surface 的屏幕上移动内容,您需要使用ScatterView 控件。

    【讨论】:

    • 感谢您的回复。在 ScatterView 中,它将项目随机分散在 Canvas 上。我已经按特定顺序安排了控件。后来我希望用户在屏幕上平滑地拖动它们。如果我在 ScatterView 中遗漏了什么,请告诉我。
    • 您可以通过在将每个 ScattervViewItem 添加到 ScatterView.Items 集合之前显式设置 Center 属性来覆盖随机性
    • @Adeel,没问题。请单击本网站上任何对您有帮助的答案旁边的复选标记
    猜你喜欢
    • 1970-01-01
    • 2011-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多