public ListTimeEntryViewModel(TimeEntry timeEntry, ListItemModelBase parent, IDataService dataService, IUserRepository userRepository)
            : base(parent, timeEntry, dataService, userRepository)
        {
            _parent = parent as ListTaskViewModel;

            ActionPanelViewFactory = new TimeEntryActionPanelViewFactory(timeEntry);
            InitUserName();
        }
Exemple #2
0
 protected ListItemModelBase(ListItemModelBase parent, IEntity entity, IDataService dataService, IUserRepository userRepository)
 {
     Children        = new ObservableCollection <ListItemModelBase>();
     Parent          = parent;
     Entity          = entity;
     _dataService    = dataService;
     _userRepository = userRepository;
 }
Exemple #3
0
        /// <summary>
        /// Performance constly on large projects.
        /// Use with care
        /// </summary>
        public void AddVisibleChild(ListItemModelBase childToAdd)
        {
            if (VisibleChildren.Contains(childToAdd))
            {
                return;
            }

            VisibleChildren.Add(childToAdd);
        }
        private void ItemSelected(ListItemModelBase obj)
        {
            var row = ListView.ItemContainerGenerator.ContainerFromItem(obj) as TreeListViewRow;

            //ListView.Items.AsQueryable().Where<>(i => i.Entity.Id == obj.Entity.Id);

            if (row != null)
            {
                row.IsSelected = true;
                //row.Focus();
            }
        }
Exemple #5
0
        private void ItemSelected(ListItemModelBase obj)
        {
            if (_selectedItem != null)
            {
                if (_selectedItem.Equals(obj))
                {
                    return;
                }

                _selectedItem.IsSelected = false;
            }
            _selectedItem = obj;
            if (_selectedItem != null)
            {
                _selectedItem.IsSelected = true;
            }
        }
Exemple #6
0
        private void CustomerDeleteCompleted(int?customerId)
        {
            if (!customerId.HasValue)
            {
                return;
            }

            if (_selectedItem != null)
            {
                if (_selectedItem is ListCustomerViewModel)
                {
                    var customerToRemove = Customers.SingleOrDefault(c => c.Customer.Id == customerId);
                    Customers.Remove(customerToRemove);
                    _selectedItem = null;
                }
            }
        }
Exemple #7
0
 public ListCustomerViewModel(Customer customer, ListItemModelBase parent, IDataService dataService, IUserRepository userRepository)
     : base(parent, customer, dataService, userRepository)
 {
     ActionPanelViewFactory = new CustomerActionPanelViewFactory(customer);
 }
 public ListTaskViewModel(Task task, ListItemModelBase parent, IDataService dataService, IUserRepository userRepository)
     : base(parent, task, dataService, userRepository)
 {
     ActionPanelViewFactory = new TaskActionPanelViewFactory(task);
     InitUserName();
 }
Exemple #9
0
 public ListProjectViewModel(Project project, ListItemModelBase parent, IDataService dataService, IUserRepository userRepository)
     : base(parent, project, dataService, userRepository)
 {
     ActionPanelViewFactory = new ProjectActionPanelViewFactory(project);
     InitUserName();
 }