internal async void OnLoadLayoutAsync(object parameter = null) { App myApp = (App)Application.Current; LayoutLoaderResult LoaderResult = await myApp.LayoutLoaded.GetLayoutString(OnLayoutLoaded_Event); // Call this even with null to ensure standard initialization takes place this.OnLayoutLoaded_Event(null, (LoaderResult == null ? null : new LayoutLoadedEventArgs(LoaderResult))); }
private async void OnLoadLayoutAsync(object parameter = null) { if (this.DataContext is WorkSpaceViewModel wspace) { wspace.CloseAllDocuments(); } App myApp = (App)Application.Current; LayoutLoaderResult LoaderResult = await this.LayoutLoaded.GetLayoutString(OnLayoutLoaded_Event); // Call this even with null to ensure standard initialization takes place this.OnLayoutLoaded_Event(null, (LoaderResult == null ? null : new LayoutLoadedEventArgs(LoaderResult))); }