123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using PDF_Master.Model;
- using Prism.Commands;
- using Prism.Mvvm;
- using Prism.Regions;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows.Controls;
- namespace PDF_Master.ViewModels.HomePanel
- {
- public class HomeChatGPTAIContentViewModel : BindableBase, INavigationAware
- {
- HomeContentViewModel homeContentViewModel = null;
- public string RegionName = "";
- private string chatGPTAIRegionName;
- public string ChatGPTAIRegionName
- {
- get { return chatGPTAIRegionName; }
- set { SetProperty(ref chatGPTAIRegionName, value); }
- }
- public IRegionManager region;
- public HomeChatGPTAIContentViewModel(IRegionManager regionManager)
- {
- region=regionManager;
- ChatGPTAIRegionName = Guid.NewGuid().ToString();
- }
- public bool IsNavigationTarget(NavigationContext navigationContext)
- {
- return true;
- }
- public void OnNavigatedFrom(NavigationContext navigationContext)
- {
- }
- public void OnNavigatedTo(NavigationContext navigationContext)
- {
- navigationContext.Parameters.TryGetValue<string>(ParameterNames.Tag, out RegionName);
- navigationContext.Parameters.TryGetValue<HomeContentViewModel>(ParameterNames.HomeContentViewModel, out homeContentViewModel);
- NavigationParameters param = new NavigationParameters();
- param.Add(ParameterNames.HomeContentViewModel, homeContentViewModel);
- region.RequestNavigate(ChatGPTAIRegionName, RegionName,param);
-
- }
- }
- }
|