Пример #1
0
 public TVCustomerViewModel(TVCustomerModel parentcustomer) : base(null, true)
 {
     Customer           = parentcustomer;
     IsExpanded         = false;
     IsSelected         = false;
     CheckBoxVisibility = Visibility.Collapsed;
 }
Пример #2
0
        /// <summary>
        /// Add new Customer Node to treeview
        /// </summary>
        /// <param name="customer">CustomerModel</param>
        public static void AddCustomerNode(TVCustomerModel customer)
        {
            Window owner = Application.Current.Windows[0];
            FullyObservableCollection <TVCustomerViewModel> customers = (owner.DataContext as AssetTreeExViewModel).allcustomers;

            customers.Add(new TVCustomerViewModel(customer));
        }
Пример #3
0
        /// <summary>
        /// Filter customers
        /// </summary>
        /// <param name="customerID"></param>
        private void GetCustomers(int customerID)                  //Proc that starts process of building data structure for treeview
        {                                                          //First stage is to build parent nodes which are the Customer nodes
            Customers.Clear();
            if (customerID == 0)
            {
                Customers = allcustomers;
            }
            else
            {
                TVCustomerModel q = (from a in customers
                                     where a.ID == customerID
                                     select a).FirstOrDefault();

                Customers.Add(new TVCustomerViewModel(q));
            }
        }