private void MainPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e) { if (AppManagement._flagExitApp == false) { Grid2.Visibility = Visibility.Collapsed; gridcontext.Visibility = Visibility.Collapsed; StoryboardBottom.Stop(); txtDanhsach.Text = "Danh sách"; AppManagement._flagExitApp = true; AppManagement._flagHouseSave = false; e.Cancel = true; } else { MessageBoxResult result = MessageBox.Show("Bạn có muốn thoát khỏi ứng dụng không?", "Thông báo", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { App.Current.Terminate(); } else { e.Cancel = true; } } }
private void ButtonShowNhaDaLuu_Tapped(object sender, System.Windows.Input.GestureEventArgs e) { if (Grid2.Visibility == Visibility.Collapsed) { Grid2.Visibility = Visibility.Visible; StoryboardBottom.Stop(); listNhaTroInMap.ItemsSource = AppManagement._nhadaluu; AppManagement._flagHouseSave = true; AppManagement._flagExitApp = false; } else { AppManagement._flagHouseSave = false; AppManagement._flagExitApp = true; Grid2.Visibility = Visibility.Collapsed; } }
private void Marker_Tapped(object sender, System.Windows.Input.GestureEventArgs e) { myMaps.MapElements.Clear(); AppManagement._marker_pre.Marker_Selected = false; AppManagement._flagclickMarker = true; var _stack_marker = sender as StackPanel; var marker = AppManagement._list_marker.FirstOrDefault(r => r.TagId == _stack_marker.Tag) as USCustomPushpin; var layer = AppManagement._layer.FirstOrDefault(r => r.Content == marker); marker.Marker_Selected = true; AppManagement._marker_pre = marker; DrawCirclesInMap circle = new DrawCirclesInMap(); circle.DrawCircles(myMaps, layer.GeoCoordinate); AppManagement.ListNhaTroInCircle.List_nt_in_circle.Clear(); for (int i = 0; i < AppManagement.list.Count; i++) { GeoCoordinate point = new GeoCoordinate(double.Parse(AppManagement.list.ElementAt(i).latitude, CultureInfo.InvariantCulture), double.Parse(AppManagement.list.ElementAt(i).longitude, CultureInfo.InvariantCulture)); if (circle.distance2M(circle.GetData_Geo.I, point) <= circle.GetData_Geo.R) { AppManagement.ListNhaTroInCircle.List_nt_in_circle.Add(new NhaTro() { id = AppManagement.list.ElementAt(i).id, price = AppManagement.list.ElementAt(i).price, area = AppManagement.list.ElementAt(i).area, title = AppManagement.list.ElementAt(i).title, updated_timestamp = AppManagement.list.ElementAt(i).updated_timestamp, slug = AppManagement.list.ElementAt(i).slug, image = AppManagement.list.ElementAt(i).image, phone = AppManagement.list.ElementAt(i).phone, site = AppManagement.list.ElementAt(i).site, flagColor = AppManagement.list.ElementAt(i).flagColor }); } } AppManagement._flagStoryBoard = true; AppManagement._flagExitApp = false; StoryboardBottom.Begin(); }
private void myMaps_ResolveCompleted(object sender, Microsoft.Phone.Maps.Controls.MapResolveCompletedEventArgs e) { if (AppManagement._flagStoryBoard == true || AppManagement._flagclickMarker == true) { AppManagement._flagStoryBoard = false; AppManagement._flagclickMarker = false; } else { if (checkNetworkConnection() == true) { if (StoryboardBottom.GetCurrentState() == ClockState.Active) { AppManagement._flagExitApp = true; StoryboardBottom.Stop(); } LocationRectangle rec = GetVisibleMapAre(myMaps); GetListNhaTro(rec.Southeast, rec.Northwest); //customIndeterminateProgressBar.IsIndeterminate = false; } } }