Repository navigation
DiGi.UI.WPF
public static class CreateInheritance System.Object → Create
Creates a solid color System.Windows.Media.Imaging.BitmapImage with the specified dimensions.
public static System.Windows.Media.Imaging.BitmapImage BitmapImage(int width, int height, System.Drawing.Color color);width System.Int32
The width of the resulting image in pixels.
height System.Int32
The height of the resulting image in pixels.
color System.Drawing.Color
The System.Drawing.Color to fill the image with.
System.Windows.Media.Imaging.BitmapImage
A System.Windows.Media.Imaging.BitmapImage representing a solid color rectangle.
Converts a System.Drawing.Image object into a System.Windows.Media.Imaging.BitmapImage.
public static System.Windows.Media.Imaging.BitmapImage? BitmapImage(System.Drawing.Image? image);image System.Drawing.Image
The source image to convert.
System.Windows.Media.Imaging.BitmapImage
A System.Windows.Media.Imaging.BitmapImage created from the provided image, or null if the input is null.
Converts a byte array into a System.Windows.Media.Imaging.BitmapImage.
public static System.Windows.Media.Imaging.BitmapImage? BitmapImage(this byte[]? bytes);bytes System.Byte[]
The byte array containing the image data.
System.Windows.Media.Imaging.BitmapImage
A System.Windows.Media.Imaging.BitmapImage created from the provided bytes, or null if the input is null.
Creates a visual wrapper for the specified background task, automatically determining if it is reportable to provide the appropriate visual implementation.
public static DiGi.UI.WPF.Interfaces.IVisualBackgroundTask VisualBackgroundTask(DiGi.Core.Interfaces.IBackgroundTask backgroundTask, string name, string description);backgroundTask DiGi.Core.Interfaces.IBackgroundTask
The background task instance to be wrapped.
name System.String
The display name of the task.
description System.String
A description of the task's operation.
IVisualBackgroundTask
An implementation of IVisualBackgroundTask that provides visual tracking for the background task.
System.ArgumentNullException
Thrown when backgroundTask is null.
public static class ModifyInheritance System.Object → Modify
Collapses all items in the specified item collection.
public static void CollapseAll(this System.Windows.Controls.ItemCollection itemCollection, bool inverse=false);itemCollection System.Windows.Controls.ItemCollection
The System.Windows.Controls.ItemCollection to collapse.
inverse System.Boolean
A boolean value indicating whether to invert the operation (expand instead of collapse).
Recursively expands or collapses all items within the specified System.Windows.Controls.ItemCollection.
public static void ExpandAll(this System.Windows.Controls.ItemCollection itemCollection, bool inverse=false);itemCollection System.Windows.Controls.ItemCollection
The collection of items to be expanded or collapsed.
inverse System.Boolean
If set to true, all items will be collapsed instead of expanded. Defaults to false.
Updates or creates a tree view item based on the provided path within an item collection.
public static DiGi.UI.WPF.Classes.ItemPathTreeViewItem? Update(this System.Windows.Controls.ItemCollection? itemCollection, DiGi.UI.WPF.Classes.ItemPath? path, System.Func<DiGi.UI.WPF.Classes.ItemPath?,DiGi.UI.WPF.Classes.ItemPathTreeViewItem?>? createFunc);itemCollection System.Windows.Controls.ItemCollection
The collection of items to search or update.
path ItemPath
The target path for the tree view item.
createFunc System.Func<ItemPath,ItemPathTreeViewItem>
A function used to create a new tree view item if it does not exist at the specified path.
ItemPathTreeViewItem
The updated or created ItemPathTreeViewItem, or null if the operation failed or inputs were null.
Updates or creates a tree view item based on the provided path within an item collection, optionally specifying a parent path for recursive traversal.
public static DiGi.UI.WPF.Classes.ItemPathTreeViewItem? Update(this System.Windows.Controls.ItemCollection? itemCollection, DiGi.UI.WPF.Classes.ItemPath? path, System.Func<DiGi.UI.WPF.Classes.ItemPath?,DiGi.UI.WPF.Classes.ItemPathTreeViewItem?>? createFunc, DiGi.UI.WPF.Classes.ItemPath? parentPath);itemCollection System.Windows.Controls.ItemCollection
The collection of items to search or update.
path ItemPath
The target path for the tree view item.
createFunc System.Func<ItemPath,ItemPathTreeViewItem>
A function used to create a new tree view item if it does not exist at the specified path.
parentPath ItemPath
The path of the parent item, used during recursive updates to track depth and hierarchy.
ItemPathTreeViewItem
The updated or created ItemPathTreeViewItem, or null if the operation failed or inputs were null.
Writes the specified bitmap image to a file using a save file dialog.
public static bool Write(System.Windows.Media.Imaging.BitmapImage? bitmapImage);bitmapImage System.Windows.Media.Imaging.BitmapImage
The bitmap image to save.
System.Boolean
True if the write operation was successful; otherwise, false.
Writes the specified bitmap image to a file at the given path.
public static bool Write(System.Windows.Media.Imaging.BitmapImage? bitmapImage, string? path);bitmapImage System.Windows.Media.Imaging.BitmapImage
The bitmap image to save.
path System.String
The destination file path.
System.Boolean
True if the write operation was successful; otherwise, false.
Writes the specified bitmap image to a file using a save file dialog to determine the destination path.
public static bool Write(System.Windows.Media.Imaging.BitmapImage? bitmapImage, out string? path);bitmapImage System.Windows.Media.Imaging.BitmapImage
The bitmap image to save.
path System.String
When this method returns, contains the path of the file that was saved, or null if the operation failed.
System.Boolean
True if the write operation was successful; otherwise, false.
public static class QueryInheritance System.Object → Query
Determines the appropriate BitmapEncoder(this FileFilter) based on the file extensions provided in the specified file filter.
public static System.Windows.Media.Imaging.BitmapEncoder? BitmapEncoder(this DiGi.Core.IO.Classes.FileFilter? fileFilter);fileFilter DiGi.Core.IO.Classes.FileFilter
The file filter containing the list of extensions to evaluate.
System.Windows.Media.Imaging.BitmapEncoder
A BitmapEncoder(this FileFilter) instance (such as System.Windows.Media.Imaging.JpegBitmapEncoder or System.Windows.Media.Imaging.PngBitmapEncoder) if a matching image extension is found; otherwise, null.
Determines the appropriate file filter based on the provided file path's extension.
public static DiGi.Core.IO.Classes.FileFilter? FileFilter(string? path);path System.String
The path of the file to evaluate.
DiGi.Core.IO.Classes.FileFilter
A FileFilter(string) instance if a matching filter is found; otherwise, null.
Retrieves the parent System.Windows.Controls.ItemsControl of a given System.Windows.DependencyObject.
public static T? Parent<T>(System.Windows.DependencyObject? dependencyObject)
where T : System.Windows.Controls.ItemsControl;T
The type of the System.Windows.Controls.ItemsControl to return.
dependencyObject System.Windows.DependencyObject
The dependency object for which to find the parent container.
T
The parent System.Windows.Controls.ItemsControl cast to T, or null if no such parent exists or the input is null.
Opens an open file dialog to select a file using a provided file filter and optionally including all files.
public static string? Path(this System.Windows.Window? window, DiGi.Core.IO.Classes.FileFilter? fileFilter=null, bool allFiles=false);window System.Windows.Window
The owner window for the dialog.
fileFilter DiGi.Core.IO.Classes.FileFilter
An optional DiGi.Core.IO.Classes.FileFilter used to filter the files.
allFiles System.Boolean
A boolean indicating whether to include a filter for all files (*.*).
System.String
The full path of the selected file, or null if the dialog was cancelled or closed.
Opens an open file dialog to select a file based on a specific type name and extension.
public static string? Path(this System.Windows.Window? window, string fileTypeName, string fileExtension);window System.Windows.Window
The owner window for the dialog.
fileTypeName System.String
The descriptive name of the file type.
fileExtension System.String
The file extension to filter by.
System.String
The full path of the selected file, or null if the dialog was cancelled or closed.
Opens an open file dialog to select a file using a custom title and a collection of file filters.
public static string? Path(this System.Windows.Window? window, string? title, System.Collections.Generic.IEnumerable<DiGi.Core.IO.Classes.FileFilter>? fileFilters);window System.Windows.Window
The owner window for the dialog.
title System.String
An optional custom title for the dialog window.
fileFilters System.Collections.Generic.IEnumerable<DiGi.Core.IO.Classes.FileFilter>
A collection of DiGi.Core.IO.Classes.FileFilter objects to define the file selection filters.
System.String
The full path of the selected file, or null if the dialog was cancelled or closed.
Opens an open file dialog to select one or more files based on the specified type name and extension.
public static string[]? Paths(this System.Windows.Window window, string fileTypeName, string fileExtension);window System.Windows.Window
The owner window that will display the dialog.
fileTypeName System.String
The descriptive name of the file type to be displayed in the dialog title and filter.
fileExtension System.String
The file extension used for filtering files (e.g., "txt").
System.String[]
An array of strings containing the paths of the selected files, or null if the dialog was cancelled or closed.
Executes the specified action while displaying indeterminate progress on the provided progress bar control.
public static void ShowProgress(this System.Action? action, DiGi.UI.WPF.Controls.ProgressBarControl? progressBarControl, string? text=null);action System.Action
The action to be executed.
progressBarControl ProgressBarControl
The progress bar control used to display progress.
text System.String
The optional text to display associated with the progress operation.
Executes the specified action while displaying an indeterminate progress window.
public static void ShowProgress(this System.Action action, System.Windows.Window? owner=null, string? text=null);action System.Action
The action to be executed.
owner System.Windows.Window
The optional owner window for the progress window.
text System.String
The optional text to display in the progress window.
Executes the specified action that requires a worker with determinate progress using the provided progress bar control.
public static void ShowProgress(this System.Action<DiGi.Core.Interfaces.IDeterminateWorker>? action, DiGi.UI.WPF.Controls.ProgressBarControl? progressBarControl, string? text=null);action System.Action<DiGi.Core.Interfaces.IDeterminateWorker>
The action to be executed, receiving the determinate worker instance.
progressBarControl ProgressBarControl
The progress bar control used to display progress.
text System.String
The optional text to display associated with the progress operation.
Executes the specified action that requires a worker with determinate progress while displaying a progress window.
public static void ShowProgress(this System.Action<DiGi.Core.Interfaces.IDeterminateWorker>? action, string? text=null);action System.Action<DiGi.Core.Interfaces.IDeterminateWorker>
The action to be executed, receiving the determinate worker instance.
text System.String
The optional text to display in the progress window.
Executes the specified action that requires a worker with indeterminate progress using the provided progress bar control.
public static void ShowProgress(this System.Action<DiGi.Core.Interfaces.IIndeterminateWorker>? action, DiGi.UI.WPF.Controls.ProgressBarControl? progressBarControl, string? text=null);action System.Action<DiGi.Core.Interfaces.IIndeterminateWorker>
The action to be executed, receiving the indeterminate worker instance.
progressBarControl ProgressBarControl
The progress bar control used to display progress.
text System.String
The optional text to display associated with the progress operation.
Executes the specified action that requires a worker with indeterminate progress while displaying a progress window.
public static void ShowProgress(this System.Action<DiGi.Core.Interfaces.IIndeterminateWorker>? action, System.Windows.Window? owner=null, string? text=null);action System.Action<DiGi.Core.Interfaces.IIndeterminateWorker>
The action to be executed, receiving the indeterminate worker instance.
owner System.Windows.Window
The optional owner window for the progress window.
text System.String
The optional text to display in the progress window.
Extracts items stored in the Tag property of controls within an ItemCollection, optionally including nested collections and filtering by selection criteria.
public static System.Collections.Generic.List<TItem>? TagItems<TItem,UControl>(this System.Windows.Controls.ItemCollection itemCollection, bool includeNested=true, bool selected=false, System.Func<UControl,bool>? selectedFunc=null)
where UControl : System.Windows.Controls.Control;TItem
The type of the item to be retrieved from the Tag property.
UControl
The specific control type to look for within the collection.
itemCollection System.Windows.Controls.ItemCollection
The ItemCollection to process.
includeNested System.Boolean
If set to true, recursively processes nested ItemsControls. Defaults to true.
selected System.Boolean
If set to true, only items from controls that satisfy the selectedFunc are included. Defaults to false.
selectedFunc System.Func<UControl,System.Boolean>
The function used to evaluate if a control is selected. This must be provided if selected is set to true.
System.Collections.Generic.List<TItem>
A list of items found in the tags, or null if the provided itemCollection is null.