示例#1
0
 public PreviewRoutePointImagesPage(AutoGeneratedPoint selectedPoint)
 {
     InitializeComponent();
     _vm            = new PreviewRoutePointImagesViewModel(selectedPoint);
     _vm.Navigation = this.Navigation;
     BindingContext = _vm;
 }
 public PreviewRoutePointImagesViewModel(AutoGeneratedRouted.AutoGeneratedPoint selectedPoint)
 {
     ToggleDeleteImageCommand = new Command(toggleDeleteImageCommand);
     BackNavigationCommand    = new Command(backNavigationCommand);
     OpenImageInViewerCommand = new Command(openImageInViewerCommand);
     _selectedPoint           = selectedPoint;
 }
示例#3
0
 public void OpenImagesPreviewPoint(AutoGeneratedPoint selectedPoint)
 {
     Analytics.TrackEvent("AutoRoute:Show point images", new Dictionary <string, string> {
         { "Name", selectedPoint.Name }
     });
     Navigation.PushModalAsync(new PreviewRoutePointImagesPage(selectedPoint));
     _selectedPreviewRoutePoint = selectedPoint;
 }
示例#4
0
        void TapGestureRecognizerDelete_Tapped(System.Object sender, System.EventArgs e)
        {
            sfListRoutePoints.ResetSwipe(true);
            var selectedItem = ((Xamarin.Forms.TappedEventArgs)e).Parameter;
            AutoGeneratedPoint selectedPoint = (AutoGeneratedPoint)selectedItem;
            var indexItem = _listView.DataSource.DisplayItems.IndexOf(selectedPoint);

            selectedPoint.IsDeleted = !selectedPoint.IsDeleted;
            Device.BeginInvokeOnMainThread(() => {
                _listView.RefreshListViewItem(indexItem, indexItem, true);
                _vm.UpdateRouteInfo();
            });
        }
示例#5
0
        private void showImagesPreviewPointCommand(object obj)
        {
            AutoGeneratedPoint selectedPoint = new AutoGeneratedPoint();

            if (obj is AutoGeneratedImage)
            {
                AutoGeneratedImage selectedImage = (AutoGeneratedImage)obj;
                selectedPoint = PreviewRoutePoints.Where(p => p.Images.Contains(selectedImage)).SingleOrDefault();
            }
            else
            {
                selectedPoint = (AutoGeneratedPoint)obj;
            }
            OpenImagesPreviewPoint(selectedPoint);
        }