punker76 / MahApps.Metro.SimpleChildWindow

A simple child window for MahApps.Metro
MIT License
374 stars 55 forks source link

how can i check if the window is opened inside c# #71

Closed ivicii closed 5 years ago

ivicii commented 6 years ago

Hello,

how can i check if the childwindow is opened inside c#?

thanks a lot!

Symbai commented 6 years ago

By doing the same this extension does:

var metroDialogContainer = window.Template.FindName("PART_MetroActiveDialogContainer", window) as Grid;
metroDialogContainer = metroDialogContainer ?? window.Template.FindName("PART_MetroInactiveDialogsContainer", window) as Grid;
if (metroDialogContainer.Children.Contains(your window)
{
    //do something
}
punker76 commented 5 years ago

I’m closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version. If it’s an enhancement and hasn’t been taken on for so long, then it seems no one has the time to implement this.

Please reopen if you still encounter this issue with the latest stable or pre-release version and please use the issue template.

Thank you! 🙏