public PresentationViewModel()
 {
     PageTitle = "Add new Presentation";
     Presentation = new Model.Presentation { Id=0, Level = PresentationLevel.Level100.ToString().Replace("Level", "") };
     this.PresentationName = Presentation.Name;
     Description = Presentation.Description;
     Level = (PresentationLevel)Convert.ToInt32(Presentation.Level);
     mode = Mode.New;
 }
 private void GetEventPresentationsForSpeaker(int eventId, int personId)
 {
     BusyMessage = "Getting your Presentations...Please wait.";
     IsBusy = true;
     LoadOperation<Person> lo = context.Load(context.GetPersonWithPresentationsQuery(personId));
     lo.Completed += delegate
     {
         foreach (var p in lo.Entities)
         {
             foreach (var ps in p.PresentationSpeakers)
             {
                 EntitySpeakerPresentations.Add(ps.Presentation);
                 var presentation = new Model.Presentation
                 {
                     Id = ps.Presentation.Id,
                     Name = ps.Presentation.Name,
                     Description = ps.Presentation.Description,
                     Level = ps.Presentation.Level,
                     PresentationSpeakers = new ObservableCollection<PresentationSpeaker>(),
                     EventPresentations = new ObservableCollection<EventPresentation>(),
                     Files = new ObservableCollection<File>()
                 };
                 foreach (var speaker in ps.Presentation.PresentationSpeakers)
                 {
                     presentation.PresentationSpeakers.Add(speaker);
                 }
                 foreach (var eventPresentation in ps.Presentation.EventPresentations)
                 {
                     presentation.EventPresentations.Add(eventPresentation);
                 }
                 foreach (var file in ps.Presentation.Files)
                 {
                     presentation.Files.Add(file);
                 }
                 if (presentation.EventPresentations.Count > 0)
                 {
                     presentation.ApprovalStatus = ps.Presentation.EventPresentations.Where(e => e.EventId == App.Event.Id).FirstOrDefault().ApprovalStatus;
                 }
                 SpeakerPresentations.Add(presentation);
             }
         }
         if (SpeakerPresentations.Count > 0)
         {
             SelectedPresentation = SpeakerPresentations.FirstOrDefault();
         }
         IsBusy = false;
     };
 }
 public void EndEdit()
 {
     copyData = new Model.Presentation();
 }
        public void CancelEdit()
        {
            currentData = copyData;
            NotifyOfPropertyChange("");

        }
 public void BeginEdit()
 {
     copyData = currentData;
 }
      partial void Command_NewPresentation (CommandType commandType, object parameter, ref bool canExecute)
      {
         canExecute = true;
         if (CommandType.Execute == commandType)
         {
            ModelContext.ChangeTracker.Clear ();
            ModelContext.RunUntracked (() =>
               {
                  Presentation = new Model.Presentation (ModelContext);

                  Presentation.Update (null as BaseModelEntity);

                  Presentation.NewSlide ();
               });
         }
      }