public static PostListingViewModel LoadViewModel(PostStore postStore, MessageStore messageStore) { PostListingViewModel viewModel = new PostListingViewModel(postStore, messageStore); viewModel.LoadPostsCommand.Execute(null); return(viewModel); }
public static PostListingViewModel LoadViewModel(PostStore postStore, Action <Task> onLoaded = null) { PostListingViewModel viewModel = new PostListingViewModel(postStore); viewModel.LoadPosts().ContinueWith(t => onLoaded?.Invoke(t)); return(viewModel); }