Class Ui
Constants
public static class Ui
- Inheritance
-
Ui
- Inherited Members
Fields
SShowDataFormFactBoxPane
The name of the command to show the DataForm FactBox pane.
public const string SShowDataFormFactBoxPane = "ShowDataFormFactBoxPane"
Field Value
SShowDataFormLog
The name of the command to show the DataForm log.
public const string SShowDataFormLog = "ShowDataFormLog"
Field Value
Properties
MainWindow
The main window.
public static Window MainWindow { get; set; }
Property Value
- Window
Settings
UI global settings.
public static UiGlobalSettings Settings { get; }
Property Value
Methods
CreateContainerNode(string, object, string, double, int)
Creates a container Avalonia.Controls.TreeViewItem node with an image.
public static TreeViewItem CreateContainerNode(string Caption, object Tag = null, string IconFile = "folder16.png", double Spacing = 5, int NegativeMargin = -8)
Parameters
CaptionstringThe node caption.
TagobjectThe node tag.
IconFilestringThe icon file name.
SpacingdoubleThe content spacing.
NegativeMarginintThe negative left margin.
Returns
- TreeViewItem
The created tree view item.
CreateLeafNode(string, object, string, double, int)
Creates a leaf Avalonia.Controls.TreeViewItem node with an image.
public static TreeViewItem CreateLeafNode(string Caption, object Tag = null, string IconFile = "item16.png", double Spacing = 5, int NegativeMargin = 0)
Parameters
CaptionstringThe node caption.
TagobjectThe node tag.
IconFilestringThe icon file name.
SpacingdoubleThe content spacing.
NegativeMarginintThe negative left margin.
Returns
- TreeViewItem
The created tree view item.
CreateTreeNode(string, FontWeight, string, object, double, int)
Creates a Avalonia.Controls.TreeViewItem node with an image.
public static TreeViewItem CreateTreeNode(string Caption, FontWeight FontWeight, string IconFile, object Tag, double Spacing = 5, int NegativeMargin = 0)
Parameters
CaptionstringThe node caption.
FontWeightFontWeightThe caption font weight.
IconFilestringThe icon file name.
TagobjectThe node tag.
SpacingdoubleThe content spacing.
NegativeMarginintThe negative left margin.
Returns
- TreeViewItem
The created tree view item.
Debug(Exception)
Writes an exception to the debug output.
public static void Debug(Exception e)
Parameters
eExceptionThe exception.
Debug(string)
Writes debug text to the UI log or debug output.
public static void Debug(string Text)
Parameters
TextstringThe text to write.
ExpandAll(ItemsControl, bool)
Expands or collapses all items in a TreeView or TreeViewItem.
public static void ExpandAll(ItemsControl Control, bool Flag)
Parameters
ControlItemsControlThe items control.
FlagboolTrue to expand; false to collapse.
ExpandAll(TreeView, bool)
Expands or collapses all items in a TreeView.
public static void ExpandAll(this TreeView tv, bool Flag)
Parameters
tvTreeViewThe tree view.
FlagboolTrue to expand; false to collapse.
ExpandAll(TreeViewItem, bool)
Expands or collapses all items in TreeViewItem.
public static void ExpandAll(this TreeViewItem Node, bool Flag)
Parameters
NodeTreeViewItemThe tree view item.
FlagboolTrue to expand; false to collapse.
GetOwnerWindow(Control)
Returns the owner window of a control.
public static Window GetOwnerWindow(this Control Control)
Parameters
ControlControlThe control.
Returns
- Window
The owner window.
GetParentWindow(Control)
Returns the parent window of a control.
public static Window GetParentWindow(this Control Control)
Parameters
ControlControlThe control.
Returns
- Window
The parent window, if any; otherwise, null.
InputBox(string, string, Control)
Shows an input box dialog.
public static Task<InputBoxData> InputBox(string Message, string Value = "", Control Caller = null)
Parameters
MessagestringThe dialog message.
ValuestringThe initial value.
CallerControlThe caller control.
Returns
- Task<InputBoxData>
The input box data.
OpenFileDialog(Control, params string[])
Shows an open file dialog.
public static Task<string> OpenFileDialog(Control Caller, params string[] Extensions)
Parameters
CallerControlThe caller control.
Extensionsstring[]The allowed file extensions.
Returns
Post(Action)
Executes an action on the UI thread (fire-and-forget).
Supports both synchronous and asynchronous delegates.
Ui.Post(async () => await DoSomethingAsync());
public static void Post(Action Proc)
Parameters
ProcActionThe action to execute.
Post(Action, DispatcherPriority)
Executes an action on the UI thread (fire-and-forget).
Supports both synchronous and asynchronous delegates.
Ui.Post(async () => await DoSomethingAsync());
public static void Post(Action Proc, DispatcherPriority Priority)
Parameters
ProcActionThe action to execute.
PriorityDispatcherPriorityThe dispatcher priority.
Post(Func<Task>)
Executes an action on the UI thread (fire-and-forget).
Supports both synchronous and asynchronous delegates.
Ui.Post(async () => await DoSomethingAsync());
public static void Post(Func<Task> Func)
Parameters
Post(Func<Task>, DispatcherPriority)
Executes an action on the UI thread (fire-and-forget).
Supports both synchronous and asynchronous delegates.
Ui.Post(async () => await DoSomethingAsync());
public static void Post(Func<Task> Func, DispatcherPriority Priority)
Parameters
SaveFileDialog(Control, params string[])
Shows a save file dialog.
public static Task<string> SaveFileDialog(Control Caller, params string[] Extensions)
Parameters
CallerControlThe caller control.
Extensionsstring[]The allowed file extensions.
Returns
ShowWaitCursor(Action, Control)
Executes an action while showing the wait cursor.
public static void ShowWaitCursor(Action Proc, Control Caller = null)
Parameters
ProcActionThe action to execute.
CallerControlThe caller control.
ShowWaitCursor<T>(Action<T>, T, Control)
Executes an action while showing the wait cursor.
public static void ShowWaitCursor<T>(Action<T> Proc, T Info, Control Caller = null)
Parameters
ProcAction<T>The action to execute.
InfoTThe action argument.
CallerControlThe caller control.
Type Parameters
TThe action argument type.