【发布时间】:2010-04-08 17:49:01
【问题描述】:
我有一个 WPF 用户控件。文件后面的代码声明了一些在 XAML 中引用的 RoutedUICommand 对象。应用程序构建并运行得很好。然而,Expression Blend 3 无法在设计器中加载 XAML,并给出如下错误:
成员“ResetCameraCommand”不是 可识别或可访问。
类和成员都是公开的。在 Blend 中构建和重建项目并重新启动 Blend 并没有帮助。任何想法是什么问题?
这是我的 XAML 的片段...
<UserControl x:Class="CAP.Visual.CameraAndLightingControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CAP.Visual;assembly=VisualApp"
Height="100" Width="700">
<UserControl.CommandBindings>
<CommandBinding Command="local:CameraAndLightingControl.ResetCameraCommand" Executed="ResetCamera_Executed" CanExecute="ResetCamera_CanExecute"/>
</UserControl.CommandBindings>
....
...以及 C# 背后的代码
namespace CAP.Visual
{
public partial class CameraAndLightingControl : UserControl
{
public readonly static RoutedUICommand ResetCameraCommand;
static CameraAndLightingControl()
{
ResetCameraCommand = new RoutedUICommand("Reset Camera", "ResetCamera", typeof(CameraAndLightingControl));
}
【问题讨论】:
-
开始赏金!趁热吃!
标签: c# wpf visual-studio-2008 expression-blend