更改光标时出现异常

时间:2015-04-27 15:15:54

标签: wpf

类型' System.Windows.Markup.XamlParseException'的第一次机会异常。发生在PresentationFramework.dll中 附加信息:'在类型' filehelpertest.MainWindow'上调用构造函数。匹配指定的绑定约束引发异常。'行号' 3'和行位置' 9'。

大家好, 我希望使用以下代码将网格光标更改为自定义光标:

        //using resources is already in the references assembly
        Cursor gameCursor = new Cursor(Application.GetResourceStream(new Uri("pack://application:,,,/Pictures/Cursor.cur")).Stream);
        MenuGrid.Cursor = gameCursor;

但由于某种原因,当我运行程序时,此异常会跳转。 .cur文件已添加到项目中并标记为资源。 任何想法?

0 个答案:

没有答案