CommandConverter无法从WPF中的System.String转换
我在使用.NET Framework 4.5的WPF中有一些奇怪的错误
我收到CommandConverter cannot convert from System.String
的错误
我的错误在哪里?
我有另一个绑定到ListView,如:
它的工作原理。
如果要使用“ Custom Routed commands
,则可以使用更详细的定义。
在类中将routed命令声明为static
,然后使用x:Static
在XAML中使用它。 你可以参考这里的答案。
为了完整答案,我发布了答案的相关代码:
namespace MyApp.Commands { public class MyApplicationCommands { public static RoutedUICommand ImportExcelCmd = new RoutedUICommand("Import excel command", "ImportExcelCmd", typeof(MyApplicationCommands)); } }
XAML
...