pkar.Wpf.Extensions 2.0.18

Prefix Reserved
dotnet add package pkar.Wpf.Extensions --version 2.0.18
                    
NuGet\Install-Package pkar.Wpf.Extensions -Version 2.0.18
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="pkar.Wpf.Extensions" Version="2.0.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="pkar.Wpf.Extensions" Version="2.0.18" />
                    
Directory.Packages.props
<PackageReference Include="pkar.Wpf.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add pkar.Wpf.Extensions --version 2.0.18
                    
#r "nuget: pkar.Wpf.Extensions, 2.0.18"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package pkar.Wpf.Extensions@2.0.18
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=pkar.Wpf.Extensions&version=2.0.18
                    
Install as a Cake Addin
#tool nuget:?package=pkar.Wpf.Extensions&version=2.0.18
                    
Install as a Cake Tool

This Nuget contains extensions of WPF classes (similar to pkar.Uwp.Extensions)

WpfMethods

Helper methods, used in this Nuget.

Function GetAppVers() As String     ' x.y.z (major, minor, build)
Function GetBuildTimestamp(bWithTime As Boolean) As String ' date in "yyyy.MM.dd HH:mm" format

classes

ValueConverterOneWay    ' since 1.2
ValueConverterOneWaySimple ' since 1.2

Extensions

Many extensions for WPF UI classes.

String.OpenExplorer()
Uri.OpenBrowser()
// WebView.GetDocumentHtmlAsync() As String

TextBlock.ShowAppVers(withDebug As Boolean) ' sets Text to x.y.z
Page.ShowAppVers(withDebug As Boolean)  ' creates TextBox in row=1 with app version

dialogboxes - all uses pkar.Localize, so strings can be localized

FrameworkElement.MsgBox(message As String)
FrameworkElement.MsgBoxAsync(message As String) As Task
FrameworkElement.DialogBoxYNAsync(message As String, Optional sYes As String = "Yes", Optional sNo As String = "No") As Task(Of Boolean))
FrameworkElement.InputBox(message As String, Optional sDefault As String = "", Optional sYes As String = "Continue", Optional sNo As String = "Cancel") As Task(Of String)

localizations (using pkar.Localize)

using object name

DependencyObject.LocalizePropertiesUsingObjectName(recursive)
XAML: <TextBox Name="uiTBox" ...>
res:  uiTBox.Text="some localized text"
.Net: uiTBox.LocalizePropertiesUsingObjectName
.Net: yourPage.LocalizePropertiesUsingObjectName(True)    ' calls LocalizePropertiesUsingObjectName in whole visual tree

using text values

DependencyObject.LocalizePrefixedProperties(recursive)
XAML: <TextBox Text="res:pagetitle" ...>
res:  pagetitle="some localized text"
.Net: uiTBox.LocalizePrefixedProperties()
.Net: yourPage.LocalizePrefixedProperties(True)    ' calls LocalizePropertiesUsingObjectName in whole visual tree

MAUI style calls

Page.GoBack()
Page.Navigate(sourcePage As Page)
Page.Navigate(sourcePage As Page, parameter As Object)
Page.Navigate(sourcePageType As Type)   ' since 1.2.1
Page.Navigate(sourcePageType As Type, parameter As Object)   ' since 1.2.1
FrameworkElement.Show()
FrameworkElement.Show(show As Boolean)
FrameworkElement.Hide()

ProgressRIng and Bar

These methods are for:

  1. ProgressRing, centered on Page, sized 50 % of Page, with TextBox for messages in center of Ring
  2. ProgressBar, on top of last Page.Grid.Row

First, you should Init this, telling what should be created (Ring, and/or Bar):

Page.ProgRingInit(bRing As Boolean, bBar As Boolean)

Then, you can show/hide it. Calls can be nested, i.e. sequence: Show(true); Show(true); Show(false) would not hide Ring/Bar.

Page.ProgRingShow(bVisible As Boolean, bForce As Boolean = False, dMin As Double = 0, dMax As Double = 100)

Any text can be shown on page center:

Page.ProgRingSetText(message As String)

Other methods (for ProgressBar):

Page.ProgRingSetMax(dMaxValue As Double)
Page.ProgRingSetVal(dValue As Double)
Page.ProgRingInc()

Application

Application.IsAnotherInstanceRunning As Boolean // since 2.0.18

Window

Window.ForceSingleInstance As Boolean // check if single instance, if not - ask if should continue, since 2.0.18

others

String.SendToClipboard
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on pkar.Wpf.Extensions:

Package Downloads
pkar.Wpf.SharedControls

Some controls, common to all my apps

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.18 262 8/5/2025
2.0.14 177 11/30/2024
1.2.1 210 1/25/2024
1.2.0 157 1/22/2024
1.1.3 172 1/19/2024

Application.Exit, to be same as in UWP; and IsAnotherInstanceRunning check