KeiChat.WinUI
6.0.3
dotnet add package KeiChat.WinUI --version 6.0.3
NuGet\Install-Package KeiChat.WinUI -Version 6.0.3
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="KeiChat.WinUI" Version="6.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KeiChat.WinUI" Version="6.0.3" />
<PackageReference Include="KeiChat.WinUI" />
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 KeiChat.WinUI --version 6.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KeiChat.WinUI, 6.0.3"
#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 KeiChat.WinUI@6.0.3
#: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=KeiChat.WinUI&version=6.0.3
#tool nuget:?package=KeiChat.WinUI&version=6.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
A modern WPF UI toolkit for building chat clients on the .NET 5+ ecosystem. Below is the usage example:
public partial class App : Application
{
private const string Tag = nameof(Tag);
static App()
{
// Configure API gateway endpoints for the demo environment.
AppSettings.SetGateway("https://api-chat-demo.chat-example.com");
AppSettings.SetUploadFileGateway("https://upload-file-chat-example.com");
AppSettings.SetUploadVideoGateway("https://upload-video-chat-example.com");
AppSettings.SetUploadPictureGateway("https://upload-picture-chat-example.com");
AppSettings.SetUploadAudioGateway("https://upload-audio-chat-example.com");
AppSettings.SetUploadMergeGateway("https://upload-merge-chat-example.com");
// Configure IM server connection details.
AppSettings.SetIMServerHost("ims://im-demo.example.com");
AppSettings.SetIMServerPort(89);
}
public App()
{
// Retrieve the assembly version string directly.
string? versionString = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString();
if (versionString != null)
{
AppSettings.SetVersion(versionString);
}
}
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// Subscribe to unhandled UI thread exceptions.
DispatcherUnhandledException += App_DispatcherUnhandledException;
// Subscribe to unhandled non-UI thread exceptions.
// AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
// Subscribe to unobserved task exceptions.
// TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
// Launch image or video viewer if a single argument is provided.
if (e.Args != null && e.Args.Length == 1)
{
// Handle preload argument.
if ("-preload".Equals(e.Args[0]))
{
LogUtilityEx.Info("KeiChatPhotoApplication", "-preload");
PhotoUI.KeiChatPhotoApplication.Preload();
return;
}
// Merge photo viewer theme resources.
Resources.MergedDictionaries.Add(new PhotoUI.Themes.Theme());
// Launch the photo/video viewer application.
PhotoUI.KeiChatPhotoApplication.Run(this, e.Args);
}
// Launch main chat application if no arguments or insufficient arguments are provided.
else if (e.Args == null || e.Args.Length < PhotoUI.KeiChatPhotoApplication.CmdArgsLength)
{
// Merge main application theme resources.
Resources.MergedDictionaries.Add(new WinUI.Themes.Theme());
// Enable phone number login.
AppSettings.EnablePhoneLogin(true);
// Set callbacks for displaying legal documents.
AppSettings.SetViewUserAgreement(UserAgreementWindow.Open);
AppSettings.SetViewPrivacyPolicy(PrivacyPolicyWindow.Open);
// Run the main chat application.
KeiChatApplication.Run(e);
}
// Launch photo viewer with specific arguments.
else
{
// Merge photo viewer theme resources.
Resources.MergedDictionaries.Add(new PhotoUI.Themes.Theme());
// Configure the endpoint for retrieving domain certificates.
PhotoUI.AppSettings.SetCertificateUrl(Service.CertificateService.GenerateUrl());
// Launch the photo/video viewer application.
PhotoUI.KeiChatPhotoApplication.Run(this, e.Args);
}
}
private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
// Log the fatal UI thread exception.
LogUtilityEx.Fatal(Tag, "Unhandled UI thread exception occurred.", e.Exception);
// Prevent application crash (uncomment to handle gracefully).
// e.Handled = true;
// Handle authentication failures specifically.
if (e.Exception is AuthenticationException authenticationException)
{
EntryWindow.ExcUnAuthorized();
}
}
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
// Log the fatal non-UI thread exception.
if (e.ExceptionObject is Exception ex)
{
LogUtilityEx.Fatal(Tag, "Unhandled non-UI thread exception occurred.", ex);
}
else
{
LogUtilityEx.Fatal(Tag, $"Unhandled non-UI thread exception object: {e}");
}
}
private void TaskScheduler_UnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
{
// Log the unobserved task exception.
LogUtilityEx.Fatal(Tag, "Unobserved task exception occurred.", e.Exception);
// Mark the exception as observed to prevent process termination.
e.SetObserved();
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. net9.0-windows was computed. net9.0-windows7.0 is compatible. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0-windows7.0
- Keisoft.IM.Client (>= 6.0.2)
- MemoryPack (>= 1.21.4)
- RestSharp (>= 112.1.0)
- System.Drawing.Common (>= 6.0.0)
- System.Management (>= 6.0.0)
-
net9.0-windows7.0
- Keisoft.IM.Client (>= 6.0.2)
- MemoryPack (>= 1.21.4)
- RestSharp (>= 112.1.0)
- System.Drawing.Common (>= 6.0.0)
- System.Management (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.