Ejemplo n.º 1
0
        async void OnLoadingChild(object sender, LoadingChildArgs e)
        {
            using (e.Wait())
            {
                // 模拟等待
                await Task.Delay(400);

                e.Children = ((ITreeData)TvData.GetTbl()).GetTreeItemChildren(e.CurrentItem.Data);
            }
        }
Ejemplo n.º 2
0
        public TvViewSelector()
        {
            InitializeComponent();

            _tv.View = new TvItemSelector
            {
                Folder = (DataTemplate)Resources["Folder"],
                File   = (DataTemplate)Resources["File"],
            };
            _tv.Data = TvData.GetTbl();
        }
Ejemplo n.º 3
0
        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("已复制到剪切板!");
        }
Ejemplo n.º 4
0
 public TvViewEx()
 {
     InitializeComponent();
     _tv.CellEx = typeof(TvViewEx1);
     _tv.Data   = TvData.GetTbl();
 }
Ejemplo n.º 5
0
 public TvDynamicLoading()
 {
     InitializeComponent();
     _tv.Data          = TvData.GetRootTbl();
     _tv.LoadingChild += OnLoadingChild;
 }
Ejemplo n.º 6
0
 void OnLoadData(object sender, RoutedEventArgs e)
 {
     _tv.Data = TvData.GetTreeData();
 }
Ejemplo n.º 7
0
 public TvInScrollViewer()
 {
     InitializeComponent();
     _tv.Data = TvData.GetTbl();
 }
Ejemplo n.º 8
0
 void OnLoadTreeData(object sender, AsyncEventArgs e)
 {
     ((CTree)sender).Data = TvData.GetTbl();
 }
Ejemplo n.º 9
0
 public TvContextMenu()
 {
     InitializeComponent();
     _tv.Data = TvData.GetTbl();
 }