private void treeView_ClickAdd(object sender, PNRoutedEventArgs e) { var item = e.SourceItem as CateDataItem; var new_item = item.Creator(item); new_item.IsNew = true; new_item.IsSelected = true; }
private void treeView_ClickEdit(object sender, PNRoutedEventArgs e) { var page = frame.Content as EditorPage; if (page != null) { page.IsEditable = true; } }
private void treeView_ClickDelete(object sender, PNRoutedEventArgs e) { var item = e.SourceItem as PNTreeViewItem; var parent = item.Parent; if (parent != null) { parent.Children.Remove(item); } else { _item_list.Remove(item); } }
private void treeView_ClickAdd(object sender, PNRoutedEventArgs e) { var item = e.SourceItem as TestData; var new_item = new TestData(new test_data_rpc() { type = PNItemType.LEAF, id = Guid.NewGuid().ToString(), name = "New Tag", desc = "", parent = item.Data as test_data_rpc, }, item); new_item.IsNew = true; new_item.IsSelected = true; }
private void treeView_ClickAdd(object sender, PNRoutedEventArgs e) { var item = e.SourceItem as CMNode; var new_item = new CMNode(new cm_node_rpc() { id = Guid.NewGuid().ToString(), name = "New Node", desc = "", parent = item.Data as cm_node_rpc, children = new List <cm_node_rpc>(), category = _categories.First() as cm_node_category_rpc, creator = new sys_user_rpc() { id = m_Main.UserInfo.id, }, }, item); new_item.IsNew = true; new_item.IsSelected = true; }
private void treeView_ClickDelete(object sender, PNRoutedEventArgs e) { var item = e.SourceItem as PNTreeViewItem; var data = item.Data as cm_node_rpc; if (m_Main.Client.remove_cm_node(data.id) != 0) { return; } if (data.parent != null) { data.parent.children.Remove(data); } var parent = item.Parent; if (parent != null) { parent.Children.Remove(item); } else { _item_list.Remove(item); } }
private void treeView_ClickEdit(object sender, PNRoutedEventArgs e) { var page = frame.Content as EditorPage; page.IsEditable = true; }
private void treeView_ClickDelete(object sender, PNRoutedEventArgs e) { var item = e.SourceItem as PNTreeViewItem; var data = item.Data as cm_node_rpc; if (m_Main.Client.remove_cm_node(data.id) != 0) { return; } if (data.parent != null) data.parent.children.Remove(data); var parent = item.Parent; if (parent != null) { parent.Children.Remove(item); } else { _item_list.Remove(item); } }
private void treeView_ClickAdd(object sender, PNRoutedEventArgs e) { var item = e.SourceItem as CMNode; var new_item = new CMNode(new cm_node_rpc() { id = Guid.NewGuid().ToString(), name = "New Node", desc = "", parent = item.Data as cm_node_rpc, children = new List<cm_node_rpc>(), category = _categories.First() as cm_node_category_rpc, creator = new sys_user_rpc() { id = m_Main.UserInfo.id, }, }, item); new_item.IsNew = true; new_item.IsSelected = true; }
private void treeView_ClickDelete(object sender, PNRoutedEventArgs e) { }