小编Don*_*nyD的帖子

将IronPython链接到WPF

我刚安装了VS2010和新的IronPython Tools扩展程序.目前,此扩展程序在双击wpf可视化控件时尚未在代码中生成事件处理程序.是否有人可以提供或指出如何在python中手动编写wpf事件处理程序的示例.我找不到任何运气,我是视觉工作室的新手.

生成新的ipython wpf项目后,自动生成的代码为:

import clr
clr.AddReference('PresentationFramework')

from System.Windows.Markup import XamlReader
from System.Windows import Application
from System.IO import FileStream, FileMode

app = Application()
app.Run(XamlReader.Load(FileStream('WpfApplication7.xaml', FileMode.Open)))
Run Code Online (Sandbox Code Playgroud)

而XAML是:

<Window 
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
       Title="WpfApplication7" Height="300" Width="300"> 
       <Button>Click Me</Button>
</Window> 
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激.

python xaml ironpython visual-studio-2010

2
推荐指数
1
解决办法
2022
查看次数

标签 统计

ironpython ×1

python ×1

visual-studio-2010 ×1

xaml ×1