应用程序的命令没有在WPF

问题描述:

使用WPF(初级):-)应用程序的命令没有在WPF

支持我不断收到

我刚刚开始 “ApplicationCommans不是在的Windows Presentation Foundation(WPF)项目支持” 的错误我的项目..

解决方案平台:AnyCPU

<Window x:Class="Wpf_CreatingARichTextEditor.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:local="clr-namespace:Wpf_CreatingARichTextEditor" 
     mc:Ignorable="d" 
     Title="MainWindow" Height="300" Width="400"> 

    <Window.CommandBindings> 

    <CommandBinding Command="ApplicationCommans.Open" 
        Executed="CommandBinding_Executed" /> 

    </Window.CommandBindings> 

    <Grid> 

    </Grid> 
</Window> 

感谢

+0

http://www.wpf-tutorial.com/commands/using-commands/ –

这不是ApplicationCommans ..它的ApplicationCommands.Open。只需更改它应该解决问题的命令的名称即可。

希望这会有所帮助。

+0

谢谢....这是令人尴尬的:-) –