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(ParameterNames.Tag, out RegionName); navigationContext.Parameters.TryGetValue(ParameterNames.HomeContentViewModel, out homeContentViewModel); NavigationParameters param = new NavigationParameters(); param.Add(ParameterNames.HomeContentViewModel, homeContentViewModel); region.RequestNavigate(ChatGPTAIRegionName, RegionName,param); } } }