예제 #1
0
        /// <summary>
        /// 加载初始化数据
        /// </summary>
        public void Init()
        {
            DishTypeMenu = new ObservableCollection <TreeNode>();
            var dishesMenus = _IDishService.LoadFatherType();

            Root = TreeNode.createRoot(0, "全部类型");
            DishTypeMenu.Add(Root);
            foreach (var menu in dishesMenus)
            {
                var child = Root.createChild(menu.DishTypeId, menu.Name);
                Root.Children.Add(child);
            }
            RaisePropertyChanged("DishWin");
        }
예제 #2
0
        public void LoadTreeNodeChildren(TreeNode selected)
        {
            if (null == selected)
            {
                return;
            }
            selectedLast = selected;
            if (selected.Parent != null)
            {
                _DishTypeIdLast = selected.Id;
            }
            DishService service     = new DishService();
            var         dishesMenus = service.LoadSubTypeById(selected.Id);

            selected.Children.Clear();
            foreach (var menu in dishesMenus)
            {
                var child = selected.createChild(menu.DishTypeId, menu.Name);
                selected.Children.Add(child);
            }
            //SelectedTreeNodeFalse(Root);
            //selected._Selected = true;
        }
예제 #3
0
 public void LoadTreeNodeChildren(TreeNode selected)
 {
     if( null==selected){
         return;
     }
     selectedLast = selected;
     if (selected.Parent != null)
     { 
         _DishTypeIdLast = selected.Id;
     }
     DishService service = new DishService();
     var dishesMenus = service.LoadSubTypeById(selected.Id);
     selected.Children.Clear();
     foreach (var menu in dishesMenus)
     {
         var child = selected.createChild(menu.DishTypeId, menu.Name);
         selected.Children.Add(child);
     }
     //SelectedTreeNodeFalse(Root);
     //selected._Selected = true;
 }
예제 #4
0
 /// <summary>
 /// 加载初始化数据
 /// </summary>
 public void Init()
 {
     DishTypeMenu = new ObservableCollection<TreeNode>();
     var dishesMenus = _IDishService.LoadFatherType();
     Root = TreeNode.createRoot(0, "全部类型");
     DishTypeMenu.Add(Root);
     foreach (var menu in dishesMenus)
     {
         var child = Root.createChild(menu.DishTypeId, menu.Name);
         Root.Children.Add(child);
     }
     RaisePropertyChanged("DishWin");
 }