Csharp/C#教程:CommandConverter无法从WPF中的System.String转换分享


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

上述就是C#学习教程:CommandConverter无法从WPF中的System.String转换分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

  ...    

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/cdevelopment/987467.html

(0)
上一篇 2021年12月22日
下一篇 2021年12月22日

精彩推荐