private void EditPost(object sender, RoutedEventArgs e)
        {
            EditPost window = new EditPost(_current_post.Id);

            window.ShowDialog();
            Refresh();
        }
示例#2
0
        private void MenuEdit_Click(object sender, RoutedEventArgs e)
        {
            var menuItem     = (MenuItem)sender;
            var contextMenu  = (ContextMenu)menuItem.Parent;
            var item         = (DataGrid)contextMenu.PlacementTarget;
            var selectedPost = (Post)item.SelectedCells[0].Item;

            var window = new EditPost(Connector, ref selectedPost);

            window.ShowDialog();
            dgPosts.Items.Refresh();
        }