private void TripListItemTapped(object sender, TappedRoutedEventArgs e) { if (sender != null && sender is StackPanel) { StackPanel stack = sender as StackPanel; if (stack.DataContext is MytripList) { MytripList tripDetail = stack.DataContext as MytripList; if (tripDetail != null) { this.Frame.Navigate(typeof(ReceiptPage), tripDetail); } } } }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { switch (PageNavigationMode.Mode) { case "Top": { Frame.ContentTransitions = new TransitionCollection { new PaneThemeTransition { Edge = EdgeTransitionLocation.Top } }; break; } case "Bottom": { Frame.ContentTransitions = new TransitionCollection { new PaneThemeTransition { Edge = EdgeTransitionLocation.Bottom } }; break; } case "Left": { Frame.ContentTransitions = new TransitionCollection { new PaneThemeTransition { Edge = EdgeTransitionLocation.Left } }; break; } case "Right": { Frame.ContentTransitions = new TransitionCollection { new PaneThemeTransition { Edge = EdgeTransitionLocation.Right } }; break; } default: { Frame.ContentTransitions = new TransitionCollection { new PaneThemeTransition { Edge = EdgeTransitionLocation.Top } }; break; } } MytripList SelectedTrip = e.Parameter as MytripList; TripReceipt tripReceipt = new TripReceipt(); tripReceipt.ArrivalTime = SelectedTrip.arrivaltime; tripReceipt.AvailbleSeat = "12A,12C,12B"; tripReceipt.CustomerName = "MR. Dharmin Naik"; tripReceipt.DepartDate = SelectedTrip.datedepart; tripReceipt.DepartFrom = SelectedTrip.From; tripReceipt.DepartTime = SelectedTrip.departtime; tripReceipt.StationName = "KRTC"; tripReceipt.TotalCost = "625.50"; tripReceipt.TravelBy = SelectedTrip.travelby; tripReceipt.TravelTo = SelectedTrip.To; tripReceipt.Via = "MYC,BKC,BC ROAD"; this.DataContext = tripReceipt; }
public Home() { try { this.InitializeComponent(); HomeModel homeModel = new HomeModel(); CommonModel.isUserLogin = false; CommonModel.bgImage = homeModel.bgBlurImage; homeModel.isUserLogin = CommonModel.isUserLogin; homeModel.isBusCodesAvailble = true; homeModel.isCabCodesAvailble = true; homeModel.isHotelCodesAvailble = true; if (CommonModel.isUserLogin) { homeModel.userImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri("ms-appx:///Assets/hdpi/home_logged_in.png", UriKind.RelativeOrAbsolute)); } IList<OfferList> _TextLists = new List<OfferList>(); OfferList item = new OfferList(); item.OfferText = "500rs Off on hotel Booking 500rs Off on hotel Booking"; item.OfferCode = "BIHOTEL500"; _TextLists.Add(item); OfferList item1 = new OfferList(); item1.OfferText = "100rs cashback on your cab Booking"; item1.OfferCode = "BICAb100"; _TextLists.Add(item1); OfferList item2 = new OfferList(); item2.OfferText = "100rs Off on next bus Booking"; item2.OfferCode = "BIBUS10000"; _TextLists.Add(item2); for (int i = 0; i < 5; i++) { OfferList item3 = new OfferList(); item3.OfferText = "200 Rs OFf on cab booking"; item3.OfferCode = "BIBus200"; _TextLists.Add(item3); } ListBoxBusCode.ItemsSource = _TextLists.ToList(); List<MytripList> tripList = new List<MytripList>(); for (int i = 0; i < 5; i++) { MytripList trip = new MytripList(); trip.From = "BANGLORE" + i; trip.To = "MANGLORE" + i; trip.travelby = "BUS"; trip.departtime = "10:30 AM"; trip.arrivaltime = "3:30 PM"; trip.datedepart = "18th feb 2015"; tripList.Add(trip); } MyTripList.ItemsSource = tripList.ToList(); this.DataContext = homeModel; this.InitializeComponent(); Frame mainFrame = Window.Current.Content as Frame; mainFrame.ContentTransitions = null; } catch (Exception) { throw; } }
public Home() { this.InitializeComponent(); HomeModel homeModel = new HomeModel(); CommonModel.isUserLogin = false; CommonModel.bgImage = homeModel.bgBlurImage; homeModel.isUserLogin = CommonModel.isUserLogin; homeModel.isBusCodesAvailble = true; homeModel.isCabCodesAvailble = true; homeModel.isHotelCodesAvailble = true; if (CommonModel.isUserLogin) { homeModel.userImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri("ms-appx:///Assets/hdpi/home_logged_in.png", UriKind.RelativeOrAbsolute)); } IList <OfferList> _TextLists = new List <OfferList>(); OfferList item = new OfferList(); item.OfferText = "500rs Off on hotel Booking 500rs Off on hotel Booking"; item.OfferCode = "BIHOTEL500"; _TextLists.Add(item); OfferList item1 = new OfferList(); item1.OfferText = "100rs cashback on your cab Booking"; item1.OfferCode = "BICAb100"; _TextLists.Add(item1); OfferList item2 = new OfferList(); item2.OfferText = "100rs Off on next bus Booking"; item2.OfferCode = "BIBUS10000"; _TextLists.Add(item2); for (int i = 0; i < 5; i++) { OfferList item3 = new OfferList(); item3.OfferText = "200 Rs OFf on cab booking"; item3.OfferCode = "BIBus200"; _TextLists.Add(item3); } ListBoxBusCode.ItemsSource = _TextLists.ToList(); //ListBoxHotelCodes.ItemsSource = _TextLists.ToList(); //ListBoxCabCode.ItemsSource = _TextLists.ToList(); List <MytripList> tripList = new List <MytripList>(); for (int i = 0; i < 5; i++) { MytripList trip = new MytripList(); trip.From = "BANGLORE" + i; trip.To = "MANGLORE" + i; trip.travelby = "BUS"; trip.departtime = "10:30 AM"; trip.arrivaltime = "3:30 PM"; trip.datedepart = "18th feb 2015"; tripList.Add(trip); } MyTripList.ItemsSource = tripList.ToList(); this.DataContext = homeModel; this.InitializeComponent(); Frame mainFrame = Window.Current.Content as Frame; mainFrame.ContentTransitions = null; UserImageLogo.Tapped += UserImageLogo_Tapped; }