async void OnLoadingChild(object sender, LoadingChildArgs e) { using (e.Wait()) { // 模拟等待 await Task.Delay(400); e.Children = ((ITreeData)TvData.GetTbl()).GetTreeItemChildren(e.CurrentItem.Data); } }
public TvViewSelector() { InitializeComponent(); _tv.View = new TvItemSelector { Folder = (DataTemplate)Resources["Folder"], File = (DataTemplate)Resources["File"], }; _tv.Data = TvData.GetTbl(); }
void OnLoadTbl(object sender, RoutedEventArgs e) { _tv.Data = TvData.GetTbl(); // xml -> code //StringBuilder sb = new StringBuilder(); //foreach (var row in (Table)_tv.Data) //{ // sb.AppendLine($"tbl.NewRow(\"{row.Str("id")}\", \"{row.Str("parentid")}\", \"{row.Str("name")}\", \"{row.Str("简码")}\");"); //} //DataPackage data = new DataPackage(); //data.SetText(sb.ToString()); //Clipboard.SetContent(data); //Kit.Msg("已复制到剪切板!"); }
public TvViewEx() { InitializeComponent(); _tv.CellEx = typeof(TvViewEx1); _tv.Data = TvData.GetTbl(); }
public TvDynamicLoading() { InitializeComponent(); _tv.Data = TvData.GetRootTbl(); _tv.LoadingChild += OnLoadingChild; }
void OnLoadData(object sender, RoutedEventArgs e) { _tv.Data = TvData.GetTreeData(); }
public TvInScrollViewer() { InitializeComponent(); _tv.Data = TvData.GetTbl(); }
void OnLoadTreeData(object sender, AsyncEventArgs e) { ((CTree)sender).Data = TvData.GetTbl(); }
public TvContextMenu() { InitializeComponent(); _tv.Data = TvData.GetTbl(); }