1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using PDF_Master.Model;
- using Prism.Mvvm;
- using Prism.Regions;
- using System;
- using System.Windows.Controls;
- namespace PDF_Master.ViewModels.HomePanel
- {
- public class HomeGuidContentViewModel : BindableBase, INavigationAware
- {
- //Todo:首页快捷工具Command事件,已写在HomePanel/PDFTools/QuickToolsContentViewModel.cs里面了
- HomeContentViewModel homeContentViewModel = null;
- private string homeToolRegionName;
- public string HomeToolRegionName
- {
- get { return homeToolRegionName; }
- set { SetProperty(ref homeToolRegionName, value); }
- }
- public IRegionManager toolregion;
- public HomeGuidContentViewModel(IRegionManager regionManager)
- {
- toolregion = regionManager;
- HomeToolRegionName = Guid.NewGuid().ToString();
- }
- public bool IsNavigationTarget(NavigationContext navigationContext)
- {
- return true;
- }
- public void OnNavigatedFrom(NavigationContext navigationContext)
- {
- }
- public void OnNavigatedTo(NavigationContext navigationContext)
- {
- navigationContext.Parameters.TryGetValue<HomeContentViewModel>(ParameterNames.HomeContentViewModel, out homeContentViewModel);
- if (homeContentViewModel != null)
- {
- NavigationParameters param = new NavigationParameters();
- param.Add(ParameterNames.HomeContentViewModel, homeContentViewModel);
- toolregion.RequestNavigate(HomeToolRegionName, "HomeFilesContent", param);
- }
- }
- }
- }
|