![]() |
VOOZH | about |
dotnet add package CG.Platform.Presentation --version 3.10.8
NuGet\Install-Package CG.Platform.Presentation -Version 3.10.8
<PackageReference Include="CG.Platform.Presentation" Version="3.10.8" />
<PackageVersion Include="CG.Platform.Presentation" Version="3.10.8" />Directory.Packages.props
<PackageReference Include="CG.Platform.Presentation" />Project file
paket add CG.Platform.Presentation --version 3.10.8
#r "nuget: CG.Platform.Presentation, 3.10.8"
#:package CG.Platform.Presentation@3.10.8
#addin nuget:?package=CG.Platform.Presentation&version=3.10.8Install as a Cake Addin
#tool nuget:?package=CG.Platform.Presentation&version=3.10.8Install as a Cake Tool
A .NET 10.0 Windows (WPF) presentation library that provides base view models, custom controls, and theme management capabilities. It builds on the CG.Infrastructure presentation stack (Core, Presentation, Navigation) to deliver a consistent WPF application shell with theme, culture, and settings management.
dotnet add package CG.Platform.Presentation
<Application x:Class="YourApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
// Program.cs or App.xaml.cs
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Platform.Presentation.Extensions;
var services = new ServiceCollection();
// Add logging
services.AddLogging(builder =>
{
builder.AddConsole();
builder.AddDebug();
});
// Register platform services (includes theme, culture, and settings services)
services.RegisterPlatformServices(configuration);
var serviceProvider = services.BuildServiceProvider();
The library provides dynamic theme switching using MahApps.Metro themes.
public class MainViewModel
{
private readonly IThemeService _themeService;
public MainViewModel(IThemeService themeService)
{
_themeService = themeService;
}
public void SwitchToDarkTheme()
{
_themeService.SetTheme("Dark.Blue");
}
public IEnumerable<string> GetAvailableThemes()
{
return _themeService.GetAvailableThemes();
}
}
<ComboBox ItemsSource="{Binding AvailableThemes}"
SelectedItem="{Binding SelectedTheme}"
SelectionChanged="OnThemeChanged" />
The library supports multi-language applications with culture switching.
public class MainViewModel
{
private readonly ICultureService _cultureService;
public MainViewModel(ICultureService cultureService)
{
_cultureService = cultureService;
}
public void SwitchToSpanish()
{
_cultureService.SetCulture("es-ES");
}
public IEnumerable<CultureInfo> GetAvailableCultures()
{
return _cultureService.GetAvailableCultures();
}
}
The library provides persistent application settings with JSON storage.
public class MainViewModel
{
private readonly ISettingsService _settingsService;
public MainViewModel(ISettingsService settingsService)
{
_settingsService = settingsService;
// Load saved settings
var savedTheme = _settingsService.GetSetting("SelectedTheme", "Light.Blue");
var savedLanguage = _settingsService.GetSetting("SelectedLanguage", "en-US");
}
public void SaveSettings()
{
_settingsService.SetSetting("SelectedTheme", "Dark.Blue");
_settingsService.SetSetting("SelectedLanguage", "es-ES");
_settingsService.SaveSettings();
}
}
The library includes a pre-built settings flyout for theme and culture management.
<mah:Flyout Header="Settings"
Position="Right"
IsOpen="{Binding IsSettingsOpen}">
<views:SettingsFlyoutView />
</mah:Flyout>
public class MainViewModel
{
public bool IsSettingsOpen { get; set; }
public void OpenSettings()
{
IsSettingsOpen = true;
}
}
All services are automatically registered when using RegisterPlatformServices():
IThemeService → ThemeServiceICultureService → CultureServiceISettingsService → SettingsServiceSettingsFlyoutViewModelSettings are automatically stored in the user's AppData folder:
%APPDATA%\Platform.Presentation\settings.jsonSee the SettingsFlyoutView and SettingsFlyoutViewModel for a complete example of theme and culture management in a WPF application.
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 net10.0-windows7.0 is compatible. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.10.8 | 128 | 4/1/2026 |
| 3.10.7 | 214 | 10/17/2025 |
| 3.10.6 | 193 | 8/16/2025 |
| 3.10.5 | 170 | 8/16/2025 |
| 3.10.4 | 217 | 8/15/2025 |
| 3.10.3 | 257 | 8/14/2025 |
| 3.0.0 | 203 | 7/18/2025 |
| 2.9.0 | 234 | 12/10/2024 |
| 2.0.4 | 282 | 8/19/2024 |
| 2.0.3 | 247 | 8/19/2024 |
| 2.0.2 | 253 | 8/19/2024 |
| 2.0.1 | 275 | 8/18/2024 |
| 2.0.0 | 274 | 8/18/2024 |
| 1.0.2 | 616 | 7/13/2022 |
| 1.0.1 | 564 | 7/13/2022 |
| 1.0.0 | 570 | 7/13/2022 |