Prism 5 legacy PDF

main
Yik Teng Hie 3 years ago
parent 40d86a807e
commit 795a180477

@ -13,11 +13,12 @@
## Migration Guides ## Migration Guides
- [Prism 4.1 to 5](https://learn.microsoft.com/en-us/previous-versions/msp-n-p/ff921144(v=pandp.40)) - [Prism 4.1 to 5](https://learn.microsoft.com/en-us/previous-versions/msp-n-p/ff921144(v=pandp.40))
- `Microsoft.Practices.Prism.ViewModel` namespace deprecated. Please use `Microsoft.Practices.Prism.Mvvm` - `Microsoft.Practices.Prism.ViewModel` namespace deprecated. Please use `Microsoft.Practices.Prism.Mvvm`
- The `BindableBase` class replaces the `NotificationObject` class. - The `BindableBase` class was added to simplify `INotifyPropertyChanged` interface.
- EventAggregator Namespace and API Changes. **NEW** `Prism.PubSubEvents` namespace - EventAggregator Namespace and API Changes. **NEW** `Prism.PubSubEvents` namespace
- Regions Namespace API Changes - Regions Namespace API Changes
- `UriQuery` class was replaced with the `NavigationParameters` - `UriQuery` class was replaced with the `NavigationParameters`
- Namespace changes - Namespace changes
- Refer to [Prism 5 pdf](./legacy/Prism5forWPF.pdf) for legacy changes
```cs ```cs
using Microsoft.Practices.Prism.ViewModel; using Microsoft.Practices.Prism.ViewModel;

@ -247,21 +247,21 @@ namespace MitechLib.Modules.PackagePage.Views
public class CarrierInfoViewModel : ViewModelBase, IHeaderInfoProvider<string> public class CarrierInfoViewModel : ViewModelBase, IHeaderInfoProvider<string>
{ {
// Step1 // Step1
public IRegionManager RegionManager { get; } private readonly IRegionManager regionManager;
// Step2 // Step2
[ImportingConstructor] [ImportingConstructor]
public CarrierInfoViewModel(IRegionManager _regionManager) public CarrierInfoViewModel(IRegionManager _regionManager)
{ {
// //
RegionManager = _regionManager; regionManager = _regionManager;
} }
// Step3 // Step3
private void OnExitCommand() private void OnExitCommand()
{ {
RegionManager.RequestNavigate(RegionNames.PackageMainViewRegion, new Uri("PackageMgmtView", UriKind.Relative)); regionManager.RequestNavigate(RegionNames.PackageMainViewRegion, new Uri("PackageMgmtView", UriKind.Relative));
} }
} }
``` ```
Loading…
Cancel
Save