utils
Utility functions to support forms module.
Functions
bitmap_from_file(bitmap_file)
Create BitmapImage from a bitmap file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bitmap_file |
str
|
path to bitmap file |
required |
Returns:
Type | Description |
---|---|
BitmapImage
|
bitmap image object |
Source code in pyrevitlib/pyrevit/forms/utils.py
load_component(xaml_file, comp_type)
Load WPF component from xaml file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xaml_file |
str
|
xaml file path |
required |
comp_type |
Controls
|
WPF control type |
required |
Returns:
Type | Description |
---|---|
Controls
|
loaded WPF control |
Source code in pyrevitlib/pyrevit/forms/utils.py
load_ctrl_template(xaml_file)
Load System.Windows.Controls.ControlTemplate from xaml file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xaml_file |
str
|
xaml file path |
required |
Returns:
Type | Description |
---|---|
ControlTemplate
|
loaded control template |
Source code in pyrevitlib/pyrevit/forms/utils.py
load_itemspanel_template(xaml_file)
Load System.Windows.Controls.ItemsPanelTemplate from xaml file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xaml_file |
str
|
xaml file path |
required |
Returns:
Type | Description |
---|---|
ControlTemplate
|
loaded items-panel template |