public void SetAutoPopulateState() { if (this.inMemoryApplicationSettingModel.GetSetting(ApplicationSetting.AllowLocation).Value&& this.inMemoryApplicationSettingModel.GetSetting(ApplicationSetting.AutoPopulateLocation).Value) { SetAsCurrentLocation(); } else if (this.inMemoryApplicationSettingModel.GetSetting(ApplicationSetting.AutoPopulateMostRecent).Value) { Recent mostRecentTrip = unitOfWork.RecentTripRepository.GetMostRecent(); if (mostRecentTrip != null) { RecentTripMessage.Send(mostRecentTrip, RecentTripMessageReason.SetAsWhereToDestination); } else { this.TextLocation = AppResources.WhereToLocationTextBoxWaterMark; } } else if (this.inMemoryApplicationSettingModel.GetSetting(ApplicationSetting.AutoPopulateMostFrequent).Value) { Recent mostFrequentTrip = unitOfWork.RecentTripRepository.GetMostFrequent(); if (mostFrequentTrip != null) { RecentTripMessage.Send(mostFrequentTrip, RecentTripMessageReason.SetAsWhereToDestination); } else { this.TextLocation = AppResources.WhereToLocationTextBoxWaterMark; } } }
private void AddToFavourites() { this.IsFavourite = true; RaisePropertyChanged("RemoveFromFavouritesVisibility"); RaisePropertyChanged("AddToFavouritesVisibility"); RecentTripMessage.Send(this, Messages.Enums.RecentTripMessageReason.AddToFavourites); }
private void SetRecentTrip(RecentTripMessage recentTripMessage) { switch (recentTripMessage.Reason) { case Messages.Enums.RecentTripMessageReason.AddToFavourites: UnitOfWork.RecentTripRepository.Update(recentTripMessage.RecentTrip); UnitOfWork.Save(); base.ShowPopup(CustomPopupMessageType.Sucess, AppResources.RecentTripsAddedToFavourites, AppResources.CustomPopupGenericOkMessage, null); break; case Messages.Enums.RecentTripMessageReason.RemoveFromFavourites: UnitOfWork.RecentTripRepository.Update(recentTripMessage.RecentTrip); UnitOfWork.Save(); base.ShowPopup(CustomPopupMessageType.Sucess, AppResources.RecentTripsRemovedFromFavourites, AppResources.CustomPopupGenericOkMessage, null); break; } }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string id; if (NavigationContext.QueryString.TryGetValue("favouriteId", out id)) { if (!String.IsNullOrEmpty(id)) { IUnitOfWork unitOfWork = SimpleIoc.Default.GetInstance <IUnitOfWork>(); Favourite favourite = unitOfWork.FavouriteRepository.GetById(Guid.Parse(id)); FavouriteMessage.Send(favourite, DrumbleApp.Shared.Messages.Enums.FavouriteMessageReason.SetAsWhereTo); } } else if (NavigationContext.QueryString.TryGetValue("recentTripId", out id)) { if (!String.IsNullOrEmpty(id)) { IUnitOfWork unitOfWork = SimpleIoc.Default.GetInstance <IUnitOfWork>(); Recent recentTrip = unitOfWork.RecentTripRepository.GetById(Guid.Parse(id)); RecentTripMessage.Send(recentTrip, DrumbleApp.Shared.Messages.Enums.RecentTripMessageReason.SetAsWhereToDestination); } } if (NavigationContext.QueryString.TryGetValue("userId", out id)) { if (!String.IsNullOrEmpty(id)) { #if !DEBUG FlurryWP8SDK.Api.SetUserId(id); #endif } } #if !DEBUG FlurryWP8SDK.Api.LogPageView(); #endif NavigationContext.QueryString.Clear(); }
private void SetRecentTrip(RecentTripMessage recentTripMessage) { switch (recentTripMessage.Reason) { case Messages.Enums.RecentTripMessageReason.SetAsWhereToDestination: if (cancellationTokenSource != null) { cancellationTokenSource.Cancel(); } LoadFavourite(recentTripMessage.RecentTrip.Text, recentTripMessage.RecentTrip.Point, SearchType.Destination); break; case Messages.Enums.RecentTripMessageReason.SetAsWhereToLocation: if (cancellationTokenSource != null) { cancellationTokenSource.Cancel(); } LoadFavourite(recentTripMessage.RecentTrip.Text, recentTripMessage.RecentTrip.Point, SearchType.Location); break; } }
private void SetRecentTrip(RecentTripMessage recentTripMessage) { switch (recentTripMessage.Reason) { case Messages.Enums.RecentTripMessageReason.SetAsWhereToDestination: if (cancellationTokenSource != null) cancellationTokenSource.Cancel(); LoadFavourite(recentTripMessage.RecentTrip.Text, recentTripMessage.RecentTrip.Point, SearchType.Destination); break; case Messages.Enums.RecentTripMessageReason.SetAsWhereToLocation: if (cancellationTokenSource != null) cancellationTokenSource.Cancel(); LoadFavourite(recentTripMessage.RecentTrip.Text, recentTripMessage.RecentTrip.Point, SearchType.Location); break; } }