private void GetPostPermaLink( int type ) { //use the GetPostRPC to get the Post.PermaLink value, then transmit that Uri to the shell PostListItem postListItem = postsListBox.SelectedItem as PostListItem; if (null == postListItem) return; GetPostRPC rpc = new GetPostRPC(App.MasterViewModel.CurrentBlog, postListItem.PostId); if( 0 == type ) rpc.Completed += OnViewPostRPCCompleted; else rpc.Completed += OnShareItemRPCCompleted; rpc.ExecuteAsync(); currentXMLRPCConnection = rpc; ApplicationBar.IsVisible = false; //hide the application bar App.WaitIndicationService.ShowIndicator(_localizedStrings.Messages.AcquiringPermalink); }
private void EditPost() { int index = postsListBox.SelectedIndex; if (-1 == index) return; App.MasterViewModel.CurrentPostListItem = App.MasterViewModel.Posts[index]; if (App.MasterViewModel.CurrentPostListItem.PostId.Equals("-1", StringComparison.Ordinal)) { // Local draft, set current post so post editor knows what to load //Make sure the post is available in the LocalPostDrafts list. if (App.MasterViewModel.CurrentBlog.LocalPostDrafts.Count <= 0 || App.MasterViewModel.CurrentBlog.LocalPostDrafts.Count <= index) { MessageBox.Show("Sorry, local draft could not be loaded!"); return; } App.MasterViewModel.CurrentPostListItem.DraftIndex = index; NavigationService.Navigate(new Uri("/EditPostPage.xaml", UriKind.Relative)); } else { //not a local draft, download the content from the server PostListItem postListItem = postsListBox.SelectedItem as PostListItem; if (null == postListItem) return; ApplicationBar.IsVisible = false; //hide the application bar App.WaitIndicationService.ShowIndicator(_localizedStrings.Messages.RetrievingPost); GetPostRPC rpc = new GetPostRPC(App.MasterViewModel.CurrentBlog, postListItem.PostId); rpc.Completed += OnGetPostRPCCompleted; rpc.ExecuteAsync(); currentXMLRPCConnection = rpc; } }