コード例 #1
0
 /// <summary>
 /// Used to close all opened documents and allows you to save unsaved results and to cancel closing.
 /// Since DocumentsViewModel is a POCO view model, an instance of this class will also expose the OnClosingCommand property that can be used as a binding source in views.
 /// </summary>
 /// <param name="cancelEventArgs">An argument of the System.ComponentModel.CancelEventArgs type which is used to cancel closing if needed.</param>
 public virtual void OnClosing(CancelEventArgs cancelEventArgs)
 {
     SaveLogicalLayout();
     if (LayoutSerializationService != null)
     {
         PersistentLayoutHelper.PersistentViewsLayout[ViewLayoutName] = LayoutSerializationService.Serialize();
     }
     Messenger.Default.Send(new CloseAllMessage(cancelEventArgs));
     PersistentLayoutHelper.SaveLayout();
 }
コード例 #2
0
 /// <summary>
 /// Finalizes the DocumentsViewModel initialization and opens the default document.
 /// Since DocumentsViewModel is a POCO view model, an instance of this class will also expose the OnLoadedCommand property that can be used as a binding source in views.
 /// </summary>
 public virtual void OnLoaded(TModule module)
 {
     IsLoaded = true;
     DocumentManagerService.ActiveDocumentChanged += OnActiveDocumentChanged;
     if (!RestoreLogicalLayout())
     {
         Show(module);
     }
     PersistentLayoutHelper.TryDeserializeLayout(LayoutSerializationService, ViewLayoutName);
 }
コード例 #3
0
 void SaveLayout()
 {
     PersistentLayoutHelper.TrySerializeLayout(LayoutSerializationService, ViewName);
 }
コード例 #4
0
 public virtual void OnLoaded()
 {
     PersistentLayoutHelper.TryDeserializeLayout(LayoutSerializationService, ViewName);
 }