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 ); }; }
public MindMapDiagram() { ViewModel = new MindMapViewModel(); SetValue(SelectedItemsProperty, DependencyProperty.UnsetValue); SetValue(ExportSettingsProperty, DependencyProperty.UnsetValue); SetValue(PrintingServiceProperty, DependencyProperty.UnsetValue); SetValue(PreviewSettingsProperty, DependencyProperty.UnsetValue); SetValue(PageSettingsProperty, DependencyProperty.UnsetValue); this.Loaded += MindMapDiagram_Loaded; this.KnownTypes = new GetTypes(GetKnownTypes); this.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFF5F5F5")); }
/// <summary> /// Method will execute when ApplyCommand executed /// </summary> private void ApplyCommandExecute(object obj) { MindMapViewModel.ChangeDiagramStyleForConnector(MindMapViewModel, IsStraightConnectorType ? "Straight" : "Curved"); foreach (var style in SelectedDiagramLevelStyles) { if (MindMapViewModel.LevelStyles.Count > style.Key) { MindMapViewModel.LevelStyles[style.Key] = new System.Tuple <string, StyleId>(MindMapViewModel.LevelStyles[style.Key].Item1, style.Value); } MindMapViewModel.ChangeStyleIdForSelectedLevel(); } foreach (var style in SelectedDiagramLevelShapes) { if (MindMapViewModel.LevelStyles.Count > style.Key) { MindMapViewModel.LevelStyles[style.Key] = new System.Tuple <string, StyleId>(style.Value, MindMapViewModel.LevelStyles[style.Key].Item2); } MindMapViewModel.ChangeItemShapeForSelectedLevel(); } //IsStraightConnectorType = true; }
public DiagramStyleViewModel(MindMapViewModel mindMapViewModel) { MindMapViewModel = mindMapViewModel; ConnectorStyles = new ObservableCollection <string>() { "Curved", "Straight" }; Levels = new ObservableCollection <string>() { "Root", "Level 1", "Level 2", "Level 3", "Level 4", }; Topics = new ObservableCollection <string>() { "Oval", "Cloud", "Rectangle", "Line", "Freehand", "Wave" }; }
/// <summary> /// Method will execute when OkCommand executed /// </summary> private void OkCommandExecute(object obj) { MindMapViewModel.AddMultipleSubTopics(SelectedItem.ToString(), MindMapViewModel.AddSubTopicCommand); MindMapViewModel.OpenCloseWindowBehavior.OpenMultipleSubTopicWindow = false; }
public MultipleSubTopicViewModel(MindMapViewModel mindMapViewModel) { MindMapViewModel = mindMapViewModel; }
public ChangeTopicViewModel(MindMapViewModel mindMapVM) { MindMapVM = mindMapVM; }
public MessageBoxWindowViewModel(MindMapViewModel mindMapViewModel) { MindMapViewModel = mindMapViewModel; }