XAML Crazy Windows

This is a port of the code described in this page: Transparent Windows in WPF

import clr clr.AddReference("System.Xml") clr.AddReference("PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") clr.AddReference("PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") from System.IO import StringReader from System.Xml import XmlReader from System.Windows.Markup import XamlReader from System.Windows import Window, Application

xaml_str="""                                        """

if __name__ == "__main__": xr = XmlReader.Create(StringReader(xaml_str)) win = XamlReader.Load(xr) win.FindName('gid').MouseRightButtonDown+=lambda x,y: win.Close win.FindName('gid').MouseLeftButtonDown+=lambda x,y: win.DragMove Application.Run(win)

Back to Contents.