private async void Timer_Tick(object sender, EventArgs e)
 {
     await Window.Dispatcher.InvokeAsync(() =>
     {
         if (Mouse.LeftButton == MouseButtonState.Released)
         {
             IsInSizeChanging     = false;
             timer.IsEnabled      = false;
             Mouse.OverrideCursor = null;
             return;
         }
         else
         {
             DirectionType directionType = GetDirectionType(isOperatingBorder).Item1;
             Point point = WindowsTool.GetPositionFull();
             if (directionType == DirectionType.Top || directionType == DirectionType.TopLeft || directionType == DirectionType.TopRight)
             {
                 SetWindowSize(0, point);
             }
             if (directionType == DirectionType.Buttom || directionType == DirectionType.ButtomLeft || directionType == DirectionType.ButtomRight)
             {
                 SetWindowSize(3, point);
             }
             if (directionType == DirectionType.Left || directionType == DirectionType.TopLeft || directionType == DirectionType.ButtomLeft)
             {
                 SetWindowSize(1, point);
             }
             if (directionType == DirectionType.Right || directionType == DirectionType.TopRight || directionType == DirectionType.ButtomRight)
             {
                 SetWindowSize(2, point);
             }
             SizeChanged?.Invoke(this, new EventArgs());
         }
     });
 }
 private void BorderChangeSize_MouseDown(object sender, MouseButtonEventArgs e)
 {
     IsInSizeChanging  = true;
     timer.IsEnabled   = true;
     isOperatingBorder = (Border)sender;
     firstPoint        = WindowsTool.GetPositionFull();
     area = new Rect(Window.Left, Window.Top, Window.Width, Window.Height);
 }