private void UpdateContent() { ReleaseVM(); if (CurrentUid.Equals(Guid.Empty)) { m_body.Content = null; m_namedViewModel = new BlankVM(); m_seeAlso.Visibility = Visibility.Collapsed; UiManager.CastDocumentCommand(EDocumentCommand.SELECTED, EAlphaKind.NONE, EAlphaDocumentKind.BLANK, Guid.Empty); } else { var descriptor = m_history[m_current].Item2; m_body.Content = descriptor.Generate(CurrentUid, out m_namedViewModel); UiManager.CastUiMessage(EUiEvent.SELECTED, m_namedViewModel.Kind, CurrentUid); foreach (var dscr in UiManager.GetDocumentDescriptors(m_namedViewModel.Kind)) { if (dscr.DocKind != descriptor.DocKind) { SeeAlso.Add(new AlphaSpecificDocumentVM(dscr, CurrentUid)); } } m_seeAlso.Visibility = Visibility.Visible; UiManager.CastDocumentCommand(EDocumentCommand.SELECTED, m_namedViewModel.Kind, descriptor.DocKind, CurrentUid); m_namedViewModel.PropertyChanged += NamedViewModelOnPropertyChanged; } UpdateTitle(); }
public virtual FrameworkElement Generate(Guid _id, out IAlphaNamedVM _namedPersistedViewModel) { _namedPersistedViewModel = AlphaClient.Instance.Get <TVM>(_id); var result = m_generateFunc((TVM)_namedPersistedViewModel); _namedPersistedViewModel.ViewCreated(); return(result); }
private void UpdateContent() { ReleaseVM(); if (CurrentUid.Equals(Guid.Empty)) { m_body.Content = null; m_namedViewModel = new BlankVM(); m_seeAlso.Visibility = Visibility.Collapsed; UiManager.CastDocumentCommand(EDocumentCommand.SELECTED, EAlphaKind.NONE, EAlphaDocumentKind.BLANK, Guid.Empty); } else { var descriptor = m_history[m_current].Item2; m_body.Content = descriptor.Generate(CurrentUid, out m_namedViewModel); UiManager.CastUiMessage(EUiEvent.SELECTED, m_namedViewModel.Kind, CurrentUid); foreach (var dscr in UiManager.GetDocumentDescriptors(m_namedViewModel.Kind)) { if (dscr.DocKind != descriptor.DocKind) SeeAlso.Add(new AlphaSpecificDocumentVM(dscr, CurrentUid)); } m_seeAlso.Visibility = Visibility.Visible; UiManager.CastDocumentCommand(EDocumentCommand.SELECTED, m_namedViewModel.Kind, descriptor.DocKind, CurrentUid); m_namedViewModel.PropertyChanged += NamedViewModelOnPropertyChanged; } UpdateTitle(); }