/// <summary> /// Drag of thumb started /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e) { _item = DataContext as TableContent; if (_item != null) { _canvas = VisualTreeHelper.GetParent(_item) as DesignerCanvas; if (_canvas != null) { _connections = VisualTreeHelperEx.FindAncestorByType <DatabaseModelDesigner>(_canvas).ViewModel.ConnectionInfoViewModels.Where(t => t.SourceViewModel.Equals(_item.TableViewModel) || t.DestinationViewModel.Equals(_item.TableViewModel)).ToList(); } _item.TableViewModel.OnPositionAndMeasureChangesStarted(); } }
/// <summary> /// Mouse drag started /// </summary> /// <param name="sender"></param> /// <param name="dragStartedEventArgs"></param> private void OnDragStarted(object sender, DragStartedEventArgs dragStartedEventArgs) { _item = DataContext as TableContent; if (_item != null) { _canvas = VisualTreeHelper.GetParent(_item) as DesignerCanvas; if (_canvas != null) { _connections = VisualTreeHelperEx.FindAncestorByType <DatabaseModelDesigner>(_canvas).ViewModel.ConnectionInfoViewModels .Where(t => !(t.DestinationViewModel.IsSelected && t.SourceViewModel.IsSelected)) .ToList(); } _item.TableViewModel.OnPositionAndMeasureChangesStarted(); _item.TableViewModel.IsMoving = true; } }