WPF Layout base
import clr clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore"); clr.AddReference('WindowsBase') clr.AddReference('System.Data') clr.AddReference('System.ComponentModel') import System from System import * from System.Data import * from System.Threading.Tasks import * from System.ComponentModel import * from System.Windows import * from System.Windows.Controls import * from System.Windows.Controls.Primitives import * from System.Windows.Media import * from System.Windows.Media.Imaging import * from System.Windows.Media.Effects import * from System.Windows.Shapes import * from System.Windows.Data import * from System.Windows.Ink import * from Microsoft.Win32 import ( OpenFileDialog, SaveFileDialog ) class WpfLayout(): def add_separater(self,parent=None): self.add_item(Separator()) def add_label(self,text): label = Label() label.Content = text self.add_item( label ) def add_button(self,text,handler=None): button = Button() button.Content = text if handler: button.Click += handler self.add_item( button )
댓글 없음:
댓글 쓰기