0

I want to minimize a window to taskbar. the simplest way is using WindowState:

WindowState = WindowState.Minimized

But by doing this the window abruptly hides. Is there a way to implement minimizing a window on wpf by keeping windows animations (like other windows when we minimized by clicking minimize button on Titlebar).

mohammad
  • 1,248
  • 3
  • 15
  • 27
  • 1
    You could get some hints from [Custom window style with minimize animation](https://stackoverflow.com/questions/21418160/custom-window-style-with-minimize-animation) – Steeeve Sep 05 '21 at 09:50
  • On my PC, `WindowState = WindowState.Minimized` triggers the default Windows animation. Are you sure animations are enabled in Windows settings? Check in sysdm.cpl - "Advanced system settings" - "Perfomance" button - The setting you want will be around the middle of the list. If it is checked, try unchecking and checking it again. – Arkane Sep 08 '21 at 10:32

1 Answers1

0

As far as I know, there's no native API in Windows to trigger that animation.

  1. You can try simulating the minimize event. The default hotkey for minimizing the focused window is Win + Arrow Down.

  2. You can use WPF animations to manipulate the window and recreate the minimize animation.

AZ Software
  • 108
  • 8