-
-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump version, add migration instructions for WPF UI v3 and v4 and upd…
…ate package configuration (#1353)
- Loading branch information
1 parent
a8917ca
commit 75aa3f8
Showing
22 changed files
with
259 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Migration plan | ||
|
||
This page outlines key changes and important details to consider when migrating. It highlights what’s new, what’s changed, and any steps you need to take to ensure a smooth transition. This isn’t a full step-by-step guide but a quick reference to help you navigate the most critical parts of the migration process. | ||
|
||
## Key changes in v2 | ||
|
||
### Global namespace change | ||
|
||
In version 2.0 the namespace has been changed from `WPF-UI` to the more .NET compatible `Wpf.Ui`. The package name has not been changed to maintain branding and consistency. | ||
|
||
### Navigation | ||
|
||
The navigation control has been rewritten yet again, making it almost completely incompatible. | ||
|
||
All navigation controls inherit from `Wpf.Ui.Controls.Navigation.NavigationBase` base class. | ||
|
||
```xml | ||
<ui:NavigationStore | ||
Frame="{Binding ElementName=RootFrame}" | ||
Precache="False" | ||
SelectedPageIndex="-1" | ||
TransitionDuration="200" | ||
TransitionType="FadeInWithSlide"> | ||
<ui:NavigationStore.Items> | ||
<ui:NavigationItem | ||
Cache="True" | ||
Content="Home" | ||
Icon="Home24" | ||
PageTag="dashboard" | ||
PageType="{x:Type pages:Dashboard}" /> | ||
<ui:NavigationSeparator /> | ||
</ui:NavigationStore.Items> | ||
<ui:NavigationStore.Footer> | ||
<ui:NavigationItem | ||
Click="NavigationButtonTheme_OnClick" | ||
Content="Theme" | ||
Icon="DarkTheme24" /> | ||
</ui:NavigationStore.Footer> | ||
</ui:NavigationStore> | ||
``` | ||
|
||
```xml | ||
<ui:NavigationFluent | ||
Frame="{Binding ElementName=RootFrame}" | ||
Precache="False" | ||
SelectedPageIndex="-1" | ||
TransitionDuration="200" | ||
TransitionType="FadeInWithSlide"> | ||
<ui:NavigationFluent.Items> | ||
<ui:NavigationItem | ||
Cache="True" | ||
Content="Home" | ||
Icon="Home24" | ||
PageTag="dashboard" | ||
PageType="{x:Type pages:Dashboard}" /> | ||
<ui:NavigationSeparator /> | ||
</ui:NavigationFluent.Items> | ||
<ui:NavigationFluent.Footer> | ||
<ui:NavigationItem | ||
Click="NavigationButtonTheme_OnClick" | ||
Content="Theme" | ||
Icon="DarkTheme24" /> | ||
</ui:NavigationFluent.Footer> | ||
</ui:NavigationFluent> | ||
``` | ||
|
||
```xml | ||
<ui:NavigationCompact | ||
Frame="{Binding ElementName=RootFrame}" | ||
Precache="False" | ||
SelectedPageIndex="-1" | ||
TransitionDuration="200" | ||
TransitionType="FadeInWithSlide"> | ||
<ui:NavigationCompact.Items> | ||
<ui:NavigationItem | ||
Cache="True" | ||
Content="Home" | ||
Icon="Home24" | ||
PageTag="dashboard" | ||
PageType="{x:Type pages:Dashboard}" /> | ||
<ui:NavigationSeparator /> | ||
</ui:NavigationCompact.Items> | ||
<ui:NavigationCompact.Footer> | ||
<ui:NavigationItem | ||
Click="NavigationButtonTheme_OnClick" | ||
Content="Theme" | ||
Icon="DarkTheme24" /> | ||
</ui:NavigationCompact.Footer> | ||
</ui:NavigationCompact> | ||
``` | ||
|
||
### Titlebar | ||
|
||
The titlebar control has been rewritten yet again, making it almost completely incompatible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Migration plan | ||
|
||
This page outlines key changes and important details to consider when migrating. It highlights what’s new, what’s changed, and any steps you need to take to ensure a smooth transition. This isn’t a full step-by-step guide but a quick reference to help you navigate the most critical parts of the migration process. | ||
|
||
## Navigation | ||
|
||
All navigation controls have been merged into one `NavigationView`, inspired by Win UI. | ||
|
||
## Icons | ||
|
||
All icons are based on the new `IconElement` control. They replaced icons in `TitleBar`, `NavigationView`, `Button` and other controls. | ||
|
||
## Control Gallery | ||
|
||
Inspired by **Win UI Controls Gallery**, a new application for testing and browsing controls was created -** WPF UI Gallery**. It replaced the Demo app. | ||
|
||
## Dialogs | ||
|
||
`ContentDialog`, `MessageBox` and `Snackbar` have been modified, their interfaces are not fully compatible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Migration plan | ||
|
||
This page outlines key changes and important details to consider when migrating. It highlights what’s new, what’s changed, and any steps you need to take to ensure a smooth transition. This isn’t a full step-by-step guide but a quick reference to help you navigate the most critical parts of the migration process. | ||
|
||
## Abstractions package | ||
|
||
Some WPF UI interfaces have been moved to a standalone package **WPF-UI.Abstractions**. You don't need to reference it, it will always be added automatically with **WPF-UI** NuGet package. | ||
|
||
## Navigation interfaces | ||
|
||
Navigation interfaces have been moved to a standalone **WPF-UI.Abstractions** package. This way, if you have models, views or other business services in another project, not related to WPF, you can develop them together for multiple applications. | ||
|
||
### New namespaces | ||
|
||
`INavigationAware` and `INavigableView` have beed moved to `Wpf.Ui.Abstractions.Controls` namespace. | ||
|
||
### Dependency injection based page creation | ||
|
||
`IPageService` have been renamed to `INavigationViewPageProvider`. | ||
|
||
Its default implementation is in the new **Wpf.Ui.DependencyInjection** package. You just need to use the `services.AddNavigationViewPageProvider()` extension and then indicate in the navigation that you want to use this interface. Then `NavigationView` will use DI container for pages creation. | ||
|
||
**Program.cs** | ||
```csharp | ||
var builder = Host.CreateDefaultBuilder(); | ||
builder.Services.AddNavigationViewPageProvider(); | ||
``` | ||
|
||
**MyWindow.xaml.cs** | ||
```csharp | ||
var pageProvider = serviceProvider.GetRequiredService<INavigationViewPageProvider>(); | ||
|
||
// NavigationControl is x:Name of our NavigationView defined in XAML. | ||
NavigationControl.SetPageProviderService(pageProvider) | ||
``` | ||
|
||
### Navigation service | ||
|
||
The `INavigationService` defined in the main package (**WPF-UI**) makes navigation management easy. You can use it for convenient injection between view models. We **HIGHLY** recommend it to be Singleton. | ||
|
||
```csharp | ||
var builder = Host.CreateDefaultBuilder(); | ||
builder.Services.AddNavigationViewPageProvider(); | ||
builder.Services.AddSingleton<INavigationService, NavigationService>(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.