Inheritance: Zetbox.Client.Presentables.DataObjectViewModel
        public CalendarItemViewModel(IViewModelDependencies dependencies, IZetboxContext dataCtx, ViewModel parent, EventViewModel obj)
            : base(dependencies, dataCtx, parent)
        {
            if (obj == null) throw new ArgumentNullException("obj");

            this.SlotWidth = this.OverlappingWidth = 1.0;
            this.EventViewModel = obj;
            this.EventViewModel.PropertyChanged += EventViewModelChanged;
            this.Event = obj.Event;
        }
 public OpenEventArgs(EventViewModel evt)
 {
     Event = evt;
 }
 public void NotifyOpen(EventViewModel evt)
 {
     var temp = Open;
     if (temp != null)
     {
         temp(this, new OpenEventArgs(evt));
     }
 }
 private IEnumerable<CalendarItemViewModel> FindCalendarItemViewModel(EventViewModel mdl)
 {
     if (mdl == null) Enumerable.Empty<CalendarItemViewModel>();
     return DayItems.SelectMany(i => i.CalendarItems.Where(c => c.EventViewModel == mdl));
 }
        public void Open(EventViewModel evt)
        {
            if (evt == null) return;
            using (var newScope = ViewModelFactory.CreateNewScope())
            {
                var newCtx = newScope.ViewModelFactory.CreateNewContext();

                var source = evt.Event.Source.GetObject(newCtx);
                if (source != null && !source.CurrentAccessRights.HasReadRights())
                {
                    newScope.ViewModelFactory.ShowMessage(CalendarResources.CannotOpenNoRightsMessage, CalendarResources.CannotOpenNoRightsCaption);
                    return;
                }

                var ws = ObjectEditor.WorkspaceViewModel.Create(newScope.Scope, newCtx);
                if (source != null)
                    ws.ShowObject(source);
                else
                    ws.ShowObject(evt.Event);
                newScope.ViewModelFactory.ShowDialog(ws, this);
            }

            _fetchCache.Invalidate();
            CurrentView.Refresh(); // A dialog makes it easy to know when the time for a refresh has come
        }