wpf - 向提示 "Window is not supported in a WPF project"添加新的IronPython WPF窗口

标签 wpf xaml visual-studio-2013 ironpython

在VS2013(使用适用于VS 2.0.11016的Python工具)中为我的VS2013的IronPython 2.7项目中添加了一个全新的未更改的WPF窗口之后,它立即在设计窗口中告诉我“无效标记”,并且错误列表显示:

Window is not supported in a Windows Presentation Foundation (WPF) project.

Grid is not supported in a Windows Presentation Foundation (WPF) project.


XAML窗口中包含以下无害的代码:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300">
    <Grid>
        
    </Grid>
</Window>
VS的Python工具是否真的不支持表单创建?我忘了配置一些东西吗?

最佳答案

该项目是作为“IronPython Windows窗体应用程序”而不是“IronPython WPF应用程序”启动的,因此缺少相关的引用资料:

  • PresentationCore
  • PresentationFramework
  • WindowsBase的

  • 添加它们会使WPF表单起作用,或者只是重新创建项目。

    如果所有这些引用似乎都在项目中,则删除/读取其中的一些引用可能会有所帮助。另一个用户报告说他必须为“PresentationFramework”这样做;也许有一对名字相同?

    关于wpf - 向提示 "Window is not supported in a WPF project"添加新的IronPython WPF窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22582094/

    相关文章:

    c# - WPF-错误 : [xxx] "does not contain a definition for [zzz] and no extension method [zzz] could be found

    c# - 具有默认内容值和绑定(bind)值的复选框

    c# - 在 WPF (MVVM) 中动态更改窗口的用户控件

    c# - WP8.1 AppBarButton 持有事件

    c# - 单元测试;正确的做法?

    c++ - Visual Studio 是否提供 C 库的 isnormal()?

    C# WPF RichText Box BackgroundProperty 从文件读取时返回 null

    wpf - 如何在 App.Xaml StartUpUri 中设置 View

    c# - 如何在 XAML 中指定 DataGrid 的 ItemsSource 类型?

    c - 是否可以使用 Visual Studio 2013 Express for Windows 查找 C 函数的堆栈深度?