![]() |
VOOZH | about |
dotnet add package CG.Infrastructure.Navigation --version 3.10.5
NuGet\Install-Package CG.Infrastructure.Navigation -Version 3.10.5
<PackageReference Include="CG.Infrastructure.Navigation" Version="3.10.5" />
<PackageVersion Include="CG.Infrastructure.Navigation" Version="3.10.5" />Directory.Packages.props
<PackageReference Include="CG.Infrastructure.Navigation" />Project file
paket add CG.Infrastructure.Navigation --version 3.10.5
#r "nuget: CG.Infrastructure.Navigation, 3.10.5"
#:package CG.Infrastructure.Navigation@3.10.5
#addin nuget:?package=CG.Infrastructure.Navigation&version=3.10.5Install as a Cake Addin
#tool nuget:?package=CG.Infrastructure.Navigation&version=3.10.5Install as a Cake Tool
A comprehensive navigation library for WPF applications that provides shared services and base view models for managing workspaces, tabs, and navigation within desktop applications.
CG.Infrastructure.Navigation is part of the CG Infrastructure library suite, designed to provide a robust foundation for building navigable WPF applications with workspace and tab management capabilities. It leverages the MVVM pattern and integrates with other infrastructure components to deliver a consistent navigation experience.
INavigationService: Main navigation orchestrator managing workspaces and tabsIWorkspaceRegistryService: Manages workspace registration and discoveryIWorkspaceDefinitionService: Handles workspace configuration and definitionsWorkspace: Represents a navigable workspace with tabs and contentTab: Individual tab within a workspaceNavigationItem: Navigation menu itemsWorkspaceDefinition: Configuration for workspace setupTabDefinition: Configuration for tab setupWorkspaceBaseViewModel: Base class for all workspace view modelsTabBaseViewModel: Base class for tab view modelsWorkspaceViewModel: Standard workspace implementationWorkspaceView: Default workspace view with tab management<PackageReference Include="CG.Infrastructure.Navigation" Version="3.10.0" />
services.AddScoped<INavigationService, NavigationService>();
services.AddScoped<IWorkspaceRegistryService, WorkspaceRegistryService>();
services.AddScoped<IWorkspaceDefinitionService, WorkspaceDefinitionService>();
public partial class MyWorkspaceViewModel : WorkspaceBaseViewModel
{
public override string WorkspaceId => "MyWorkspace";
public override string Title => "My Workspace";
public override string Description => "A custom workspace";
public override string Icon => "🚀";
public override int WorkspaceOrder => 1;
}
var workspace = await navigationService.NavigateToWorkspaceAsync(
typeof(MyWorkspaceViewModel),
typeof(MyWorkspaceView),
"My Workspace",
"Custom workspace description"
);
var tab = await navigationService.NavigateToTabAsync(
typeof(MyTabViewModel),
typeof(MyTabView),
"My Tab",
"📋"
);
Override InitilizeNavigationItems in your workspace view model to add custom navigation:
protected override void InitilizeNavigationItems(WorkspaceDefinition workspaceDefinition)
{
NavigationItems.Add(new NavigationItem
{
Title = "Custom Action",
Command = new RelayCommand(ExecuteCustomAction)
});
}
Define workspace configurations for dynamic loading:
var definition = new WorkspaceDefinition
{
ViewType = typeof(MyWorkspaceView).FullName,
Title = "Dynamic Workspace",
Description = "Created at runtime"
};
Manage tabs programmatically:
// Close a tab
await navigationService.CloseTabAsync(tab);
// Select a specific tab
await navigationService.SelectTabAsync(tab);
// Get current tab
var currentTab = navigationService.CurrentTab;
This library is part of the CG Infrastructure suite. Contributions should follow the established patterns and maintain compatibility with the broader infrastructure ecosystem.
See the LICENSE file in the root directory for licensing information.
For issues, questions, or contributions, please refer to the main Infrastructure repository or contact the development team.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 net10.0-windows7.0 is compatible. |
Showing the top 1 NuGet packages that depend on CG.Infrastructure.Navigation:
| Package | Downloads |
|---|---|
|
CG.Platform.Presentation
Platform Presentation library with shared services |
This package is not used by any popular GitHub repositories.