【问题标题】:No ContentControl.RaiseEvent in Windows Phone 7Windows Phone 7 中没有 ContentControl.RaiseEvent
【发布时间】:2011-07-10 15:16:55
【问题描述】:

注意:这个问题(部分)与:Simulating events on UIElement's without inheriting on Windows Phone 7

我已经使用它制作了一个自定义用户控件:

public class MyClass : ContentControl {
    public void SomeMethod() {
        // ...
    }
}

但我无法调用 ContentControl 的 RaiseEvent 方法。 IIRC,ContentControl 继承自 UIElement,但为什么我会收到错误消息,指出 RaiseEvent 未在此上下文中定义?

我使用的是 Silverlight (Windows Phone 7),所以这是一个问题,因为它是 WPF 的一个子集,而且我一直在处理 Silverlight 中很多功能不足的问题。

【问题讨论】:

    标签: c# .net silverlight windows-phone-7


    【解决方案1】:

    这是 Silverlight 中的 UIElement 成员列表:

    http://msdn.microsoft.com/en-us/library/system.windows.uielement(v=VS.95).aspx

    以及 WPF (.net 4.0) 中的这一成员

    http://msdn.microsoft.com/en-us/library/system.windows.uielement(v=VS.100).aspx

    显然此方法不包含在 Silverlight(和 WP7)中。

    【讨论】:

      猜你喜欢
      • 2012-01-11
      • 1970-01-01
      • 2012-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-04
      相关资源
      最近更新 更多