private void fillMyPlaces() { MyPlaces = ApplicationState.Current.Cache.MyPlaces.Items.Values.Cast <MyPlaceLightDTO>().ToList(); var currentPlace = Entry.MyPlace; if (currentPlace != null) { SelectedMyPlace = ApplicationState.Current.Cache.MyPlaces.GetItem(currentPlace.GlobalId); } else { SelectedMyPlace = ApplicationState.Current.Cache.MyPlaces.Items.Values.Where(x => x.IsDefault).Single(); } }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (!EditMode) {//when we browser other user calendar we shouldn't retrieve my places MyPlaces = new List <MyPlaceLightDTO>(); MyPlaces.Add(Entry.MyPlace); SelectedMyPlace = Entry.MyPlace; return; } ctrlTimer.IsStarted = EditMode && ApplicationState.Current.IsTimerEnabled; if (!ApplicationState.Current.Cache.MyPlaces.IsLoaded) { ApplicationState.Current.Cache.MyPlaces.Loaded += OnMyPlacesOnLoaded; progressBar.ShowProgress(true, ApplicationStrings.MsgRetrievingMyPlaces); ApplicationState.Current.Cache.MyPlaces.Load(); } else { fillMyPlaces(); } }