{"id":18814369,"url":"https://github.com/nullsoftware/utoolkit","last_synced_at":"2025-08-11T23:05:12.447Z","repository":{"id":64881469,"uuid":"459537029","full_name":"nullsoftware/UToolKit","owner":"nullsoftware","description":"UToolKit contains different MVVM common use services for WPF.","archived":false,"fork":false,"pushed_at":"2023-06-18T03:28:27.000Z","size":107,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-12T21:24:27.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nullsoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-15T10:48:49.000Z","updated_at":"2023-12-12T17:11:39.000Z","dependencies_parsed_at":"2023-02-15T13:31:50.406Z","dependency_job_id":null,"html_url":"https://github.com/nullsoftware/UToolKit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nullsoftware/UToolKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullsoftware%2FUToolKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullsoftware%2FUToolKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullsoftware%2FUToolKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullsoftware%2FUToolKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullsoftware","download_url":"https://codeload.github.com/nullsoftware/UToolKit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullsoftware%2FUToolKit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269970120,"owners_count":24505466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T23:40:34.911Z","updated_at":"2025-08-11T23:05:12.423Z","avatar_url":"https://github.com/nullsoftware.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua)\n\n[![](https://img.shields.io/nuget/vpre/UToolKit)](https://www.nuget.org/packages/UToolKit/)\n[![](https://img.shields.io/nuget/dt/UToolKit)](https://www.nuget.org/packages/UToolKit/)\n\n# UToolKit\nLibrary that contains useful tools for WPF application.  \nIt is recommended to use this library with [Fody.PropertyChanged](https://github.com/Fody/PropertyChanged).\n\nMain features:\n- **ObservableObject** (`INotifyPropertyChanged` implementation)\n- **IRefreshableCommand** (inherits `ICommand`, allows to call `ICommand.CanExecuteChanged` manually)\n- **RelayCommand** (`IRefreshableCommand` implementation)\n- **RelayAsyncCommand** (`IRefreshableCommand` async implementation)\n- **RelaySingleTaskAsyncCommand** (`IRefreshableCommand` async implementation, designed for single task execution)\n\nConverters:\n- **InverseBooleanConverter**\n- **BooleanToVisibilityConverter**\n- **BooleanToHiddenVisibilityConverter**\n- **InverseBooleanToHiddenVisibilityConverter**\n- **InverseBooleanToVisibilityConverter**\n\nExtensions:\n- **ControlExtensions**\n  * `FocusMode` - focus mode for `Control`. There is two modes: `Default` and `FocusOnLoad`.\n- **HyperlinkExtensions**\n  * `IsExternal` - if `true` Hyperlink will execute `Process.Start` using `Hyperlink.NavigateUri` after click.\n- **WindowExtensions**\n  * `CloseCommand` - command which executes on windows closing. If `ICommand.CanExecute()` returns false - window closing will be cancalled.\n  * `CloseCommandParameter` - parameter for `CloseCommand`.\n  * `PlacementStorageStrategy` - window placement storage strategy.\n  There are 2 different implemented strategies, `RegistryStorage` and `SettingsStorage`.\n  It is possible to implement custom strategy using `IWindowPlacementStorage`.  \n- **RoutedCommand bindings** - allows to bind `ICommand` to `RoutedCommand`.\n\nServices:\n- **IWindowService** - (implementation: **WindowService**)\n  * `IsActive` - indicates whether the window is active.\n  * `IsVisible` - indicates whether the window is visible.\n  * `Activate()` - attempts to brind the window to the foreground and activates it.\n  * `Close()` - closes window.\n  * `Close(bool dialogResult)` - closes window with specified dialog result.\n  * `Hide()` - hides window.\n  * `Show()` - shows window.\n- **ITextBoxService** - (implementation: **TextBoxService**)\n  * event `TextChanged` - informs that the text has changed.\n  * event `SelectionChanged` - informs that the selection has changed.\n  * `Text` - allows to get or set text to `TextBox` (will not break bindings).\n  * `CaretIndex` - gets current caret index.\n  * `SelectionLength` - gets selected text length.\n  * `SelectedText` - gets or sets selected text in text box (will not break bindings).\n  * `Select(int start, int length)` - selects a range of text in text box.\n  * `SelectAll()` - selects all text in text box.\n- **IPasswordSupplier** - (implementation: **PasswordSupplier**)\n  * event `PasswordChanged` - occurs when the password of the `PasswordBox` changes.\n  * `Password` - allows to get or set password from/to `PasswordBox`.\n  * `SecurePassword` - gets secure password from `PasswordBox`.\n  * `Clear()` - clears all password.\n\n## Getting started.\nUse one of the follwing methods to install and use this library:\n\n- **Package Manager:**\n\n    ```batch\n    PM\u003e Install-Package UToolKit\n    ```\n\n- **.NET CLI:**\n\n    ```batch\n    \u003e dotnet add package UToolKit\n    ```\n----\nFirst you need to include namespace to your code or markup.  \n\nFor **XAML** it can look like:\n```XAML\n\u003cWindow xmlns:tk=\"https://github.com/nullsoftware/UToolKit\" /\u003e\n```\n\nAnd for **C#**:\n```C#\nusing NullSoftware;\nusing NullSoftware.Services;\nusing NullSoftware.ToolKit;\nusing NullSoftware.ToolKit.Converters;\nusing NullSoftware.ToolKit.Extensions;\n```\n## Examples\nTo use converters just add `MergedDictionary` with source `pack://application:,,,/UToolKit;component/ToolKit/Converters.xaml` in your `App.xaml`:\n```xaml\n\u003cApplication\n    x:Class=\"ExampleProject.App\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"clr-namespace:ExampleProject\"\n    StartupUri=\"MainWindow.xaml\"\u003e\n    \n    \u003cApplication.Resources\u003e\n        \u003cResourceDictionary\u003e\n            \u003cResourceDictionary.MergedDictionaries\u003e\n                \u003cResourceDictionary Source=\"pack://application:,,,/UToolKit;component/ToolKit/Converters.xaml\" /\u003e\n            \u003c/ResourceDictionary.MergedDictionaries\u003e\n        \u003c/ResourceDictionary\u003e\n    \u003c/Application.Resources\u003e\n\u003c/Application\u003e\n```\n----\n\nHow to set `PlacementStorageStrategy`:  \n\n```XAML\n\u003cWindow xmlns:tk=\"https://github.com/nullsoftware/UToolKit\" \n        tk:WindowExtensions.PlacementStorageStrategy=\"{tk:RegistryStorage}\" /\u003e\n        \n        \n\u003c!--also there is possible to specify name or other registry storage properties--\u003e\n\u003cWindow xmlns:tk=\"https://github.com/nullsoftware/UToolKit\" \n        tk:WindowExtensions.PlacementStorageStrategy=\"{tk:RegistryStorage NameFormat=Placement, Hive=CurrentUser, Key='SOFTWARE\\MyCompany\\MyApp'}\" /\u003e\n```\nor\n```XAML\n\u003cWindow xmlns:tk=\"https://github.com/nullsoftware/UToolKit\" \n        xmlns:prop=\"clr-namespace:ExampleProject.Properties\"\n        tk:WindowExtensions.PlacementStorageStrategy=\"{tk:SettingsStorage Settings={x:Static prop:Settings.Default}}\" /\u003e\n```\n----\nHow to use `RoutedCommandHandlers`:\n```XAML\n\u003cWindow xmlns:tk=\"https://github.com/nullsoftware/UToolKit\"\u003e\n    \u003c!-- here we bind ICommand to RouteUICommand --\u003e\n    \u003ctk:RoutedCommandHandlers.Commands\u003e\n        \u003ctk:RoutedCommandHandler RoutedCommand=\"ApplicationCommands.Create\" Command=\"{Binding CreateCommand}\"/\u003e\n        \u003ctk:RoutedCommandHandler RoutedCommand=\"ApplicationCommands.Open\" Command=\"{Binding OpenCommand}\"/\u003e\n    \u003c/tk:RoutedCommandHandlers.Commands\u003e\n    \n    \u003c!-- here our app content --\u003e\n    \u003cGrid\u003e\n        \u003cGrid.RowDefinitions\u003e\n            \u003cRowDefinition Height=\"Auto\"/\u003e\n            \u003cRowDefinition/\u003e\n        \u003c/Grid.RowDefinitions\u003e\n        \n        \u003cMenu Grid.Row=\"0\"\u003e\n            \u003cMenuItem Header=\"_File\"\u003e\n                \u003cMenuItem Header=\"_New\" Command=\"ApplicationCommands.Create\" /\u003e\n                \u003cMenuItem Header=\"_Open\" Command=\"ApplicationCommands.Open\" /\u003e\n            \u003c/MenuItem\u003e\n        \u003c/Menu\u003e\n    \u003c/Grid\u003e\n\u003c/Window\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullsoftware%2Futoolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullsoftware%2Futoolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullsoftware%2Futoolkit/lists"}