Example #1
0
        private void LoadData(AgendaDay agendaDay)
        {
            this.AgendaDay = agendaDay;

            this.Outlets.Clear();
            this.AllOutlets.Clear();
            foreach (var outlet in this.AgendaDay.Outlets)
            {
                var viewModel = new AgendaOutletViewModel(this, outlet);
                this.Outlets.Add(viewModel);
                this.AllOutlets.TryAdd(outlet.Id, viewModel);
            }
        }
Example #2
0
        private void ActivityInserted(object sender, ActivityEventArgs e)
        {
            var activity = e.Activity;
            var outlet   = activity.Outlet;

            var outletViewModel = FindOutletViewModel(outlet);

            if (outletViewModel == null)
            {
                // Create new OutletViewModel
                outletViewModel = new AgendaOutletViewModel(this, new AgendaOutlet(outlet, new List <Activity>()));

                // Add it to the list
                this.AllOutlets.TryAdd(outlet.Id, outletViewModel);
            }

            // Add the new activity
            outletViewModel.Activities.Add(new ActivityViewModel(outletViewModel, activity));

            this.Sort();
            this.ApplyCurrentTextSearch();
        }