Ejemplo n.º 1
0
 public MindMapPage()
 {
     this.ViewModel      = new MindMapViewModel();
     this.BindingContext = this.ViewModel;
     InitializeComponent();
     dndLayout.DoubleTapped += (object sender, EventArgs e) =>
     {
         TappedEventArgs evnt           = e as TappedEventArgs;
         Point           tappedLocation = (Point)evnt.Parameter;
         MindMapEntity   mapEntity      = new MindMapEntity
         {
             Title = $"MindMap{tappedLocation.X}{tappedLocation.Y}"
         };
         MindMapView   mindMapView = new MindMapView(mapEntity);
         DraggableView mindMapDrag = new DraggableView {
             Content = mindMapView
         };
         TapGestureRecognizer tapGesture = new TapGestureRecognizer();
         tapGesture.Tapped += (sender1, e1) =>
         {
             this.ViewModel.CurrentMindMapEntity = (sender1 as MindMapView).MapEntity;
         };
         mindMapView.GestureRecognizers.Add(tapGesture);
         this.dndLayout.Children.Add(
             mindMapDrag,
             tappedLocation
             );
     };
 }
Ejemplo n.º 2
0
 public MindMapView(MindMapEntity entity = null)
 {
     this.MapEntity      = entity;
     this.BindingContext = this.MapEntity;
     InitializeComponent();
 }