WPF Application; how to only have one window in the taskbar [duplicate]

At the moment my WPF app opens a new icon in the taskbar when a new window is opened like the default. However, I only want one window in the taskbar at anyone time.

Is there a property in the app.xaml that can do this? Or how can I this?


Solution 1:

In all Windows that you don't want to show in taskbar use ShowInTaskbar="False"

Example:

<Window ShowInTaskbar="False">
    <!-- rest of code -->
</Window> 

If you want to have only one icon for many instances of the same application then i don't think if this is possible. You can open them inside your application as a new window and set ShowInTaskbar programically to achieve something similar.