Feel me, I'm new to GUI programming, IronPython, WPF and .NET. However, I am pretty familiar with Python. I have looked through a lot of online manuals, but none of them relate to the exact problem I encountered. (Perhaps this is trivial? But itβs not so easy for someone like me!)
Problem. I would like to know how to start a new WPF window (XAML) in a new window from my Windows.System.Application. Basically, I want to launch the "About" dialog in the help menu of my application. I know this can be achieved with System.Windows.Forms.Form, but in the end I want to be able to load more complex windows using XAML markup.
Currently, when I click "About" (mnuAboutClick), this loads the XAML window, but the process is replacing / destroying the original main window (WpfMainWindow). I want both windows to stay open.
EDIT: Alternatively, is there a way to load xaml into System.Windows.Forms.Form? That would be suitable for my needs.
Here is an example of my code:
import wpf from System.Windows import Application, Window class MyWindow(Window): def __init__(self): wpf.LoadComponent(self, 'WpfMainWindow.xaml') def mnuAboutClick(self, sender, e): print 'About Menu Click' wpf.LoadComponent(self, 'WpfAboutWindow.xaml')
source share