MVVM绑定具有父ID的TreeView [英] Mvvm bind treeview with parent id

查看:67
本文介绍了MVVM绑定具有父ID的TreeView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好请帮我.我要吃饭我该如何在我的treeview中绑定它(使用mvvm)??

Hi guys. Please help me. I have to table. How can i bind this in my treeview(use mvvm)????

推荐答案

 public partial class LibKind
    {
        #region Constructor

        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public LibKind()
        {
            LibTypeTree = new HashSet<LibTypeTree>();
        }

        #endregion

        #region Properties

        public int id { get; set; }

        [StringLength(10)]
        public string Code { get; set; }

        [StringLength(100)]
        public string Name { get; set; }

        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<LibTypeTree> LibTypeTree { get; set; }

        #endregion

    }



  public partial class LibTypeTree
    {
        #region Constructor

        [SuppressMessage("Microsoft.Usage",
            "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public LibTypeTree()
        {
            LibMaterial = new HashSet<LibMaterial>();
        }

        #endregion


        #region Properties

        public int Id { get; set; }

        [StringLength(100)]
        public string Code { get; set; }

        [StringLength(100)]
        public string Name { get; set; }

        public int? upper_id { get; set; }

        public int? kind_id { get; set; }

        public virtual LibKind LibKind { get; set; }

        [SuppressMessage("Microsoft.Usage",
            "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<LibMaterial> LibMaterial { get; set; }

        #endregion

    }



这篇关于MVVM绑定具有父ID的TreeView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆