private static void OnElementMove(DependencyObject d, DependencyPropertyChangedEventArgs e) { var _2 = d as UIElement; var _win = Window.GetWindow(_2) as AyWindowBase; if (_win.IsNotNull()) { if (_2.IsNotNull()) { ElementMoveMode newValue = (ElementMoveMode)e.NewValue; switch (newValue) { case ElementMoveMode.None: break; case ElementMoveMode.Move: AyExtension.SetAyWindowMouseLeftButtonMove(_win, _2); break; case ElementMoveMode.MoveAndDoubleClickMax: AyExtension.SetAyWindowMouseLeftButtonCommonClick(_win, _2); break; } } } else { if (!WpfTreeHelper.IsInDesignMode) { throw new Exception("your window is not inherit from aywindow"); } } }
private void _ViewStart_Loaded(object sender, RoutedEventArgs e) { AyExtension.SetAyWindowMouseLeftButtonCommonClick(this); }