private void pageChange(PageChangeModel changeModel) { if (changeModel.Page == PageEnum.WPFPage) { WebOrHostDisplayEvent?.Invoke(Visibility.Hidden, Visibility.Visible); ResolveWPFPage(changeModel); return; } if (changeModel.Page == PageEnum.WebPage) { WebOrHostDisplayEvent?.Invoke(Visibility.Visible, Visibility.Hidden); Task.Factory.StartNew(() => EventBus.Default.Trigger(new NavigateEventData() { Url = changeModel.Url, NavigateType = NavigateEnum.Url })); return; } if (changeModel.Page == PageEnum.WebComponet) { Task.Factory.StartNew(() => EventBus.Default.Trigger(new NavigateEventData() { NavigateType = NavigateEnum.Component, ComponentDto = changeModel.ComponentDto })); } }
private void ResolveWPFPage(PageChangeModel pageChange) { if (pageChange.Page == PageEnum.WPFPage && pageChange.FullType != null) { try { headTitle.UpdateTitle(pageChange.Title); var page = iocManager.Resolve(pageChange.FullType); MainViewModel.MainFrame = page; } catch (Exception ex) { notifiaction.AddNotifiaction(new NotifiactionModel() { Content = ex.Message, Title = ex.Source }); } } }