WPF C# - How do I avoid grouping taskbar icons?

核能气质少年 提交于 2021-02-19 15:26:02

问题


When I create a new window using .Show(), it shows the new window, however my icons are grouped like below:

I don't want that. I want the icons to be separate because I want my users to easily open the window that they want instead of having to click it, view the list of open windows, then choosing which one they want every time. I don't want to use .ShowDialog() because I need the users to be able to focus on either window no matter the state of the other. Meaning, both windows will need to be open and the user will need to be able to interact with each of those windows regardless of if the other window is open or minimized.

I've tried setting the parent, but I don't think I'm taking the right approach. I've never worked with icons before, so excuse my lack of knowledge.

var w = new Window();
w.Owner = Window.GetWindow(this);
w.Show();

I will be changing the icon of the second window that gets opened so that the user knows which one to click on based on what they want. I'm just trying to get around the grouping that seems to be the default.


回答1:


(If i'm correct) In Windows it's possible to assign a seperate AppUserModelID to your shortcut icon to prevent the default grouping of icons, this is the page explaining how to define and assign a seperate AppUserModelID. I would suggest reading the provided source thouroughly.



来源:https://stackoverflow.com/questions/50847905/wpf-c-sharp-how-do-i-avoid-grouping-taskbar-icons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!