def __init__(self, xaml_source, literal_string=False): """Initialize WPF window and resources.""" # self.Parent = self wih = Interop.WindowInteropHelper(self) wih.Owner = AdWindows.ComponentManager.ApplicationWindow if not literal_string: if not op.exists(xaml_source): wpf.LoadComponent(self, os.path.join(EXEC_PARAMS.command_path, xaml_source) ) else: wpf.LoadComponent(self, xaml_source) else: wpf.LoadComponent(self, framework.StringReader(xaml_source)) #2c3e50 #noqa self.Resources['pyRevitDarkColor'] = \ Media.Color.FromArgb(0xFF, 0x2c, 0x3e, 0x50) #23303d #noqa self.Resources['pyRevitDarkerDarkColor'] = \ Media.Color.FromArgb(0xFF, 0x23, 0x30, 0x3d) #ffffff #noqa self.Resources['pyRevitButtonColor'] = \ Media.Color.FromArgb(0xFF, 0xff, 0xff, 0xff) #f39c12 #noqa self.Resources['pyRevitAccentColor'] = \ Media.Color.FromArgb(0xFF, 0xf3, 0x9c, 0x12) self.Resources['pyRevitDarkBrush'] = \ Media.SolidColorBrush(self.Resources['pyRevitDarkColor']) self.Resources['pyRevitAccentBrush'] = \ Media.SolidColorBrush(self.Resources['pyRevitAccentColor']) self.Resources['pyRevitDarkerDarkBrush'] = \ Media.SolidColorBrush(self.Resources['pyRevitDarkerDarkColor']) self.Resources['pyRevitButtonForgroundBrush'] = \ Media.SolidColorBrush(self.Resources['pyRevitButtonColor'])
def _make_column_datatemplate(self, package_param_name): dtobj = Windows.DataTemplate() template = self.dt_template.format(param=package_param_name) return wpf.LoadComponent(dtobj, framework.StringReader(template))