Closed Josrph closed 2 years ago
when calling ShowChildWindowAsync() my ContentControl Loaded event gets called twice ... it does not suppose to do that.
var view = new ContentControl(); view.Loaded += (s, arg) => { // gets called twice ??? }; var childWindow = new ChildWindow() { ChildWindowWidth = 400, ChildWindowHeight = 300, ShowCloseButton = true, IsOpen = true, IsModal = true, Content = view, }; await App.Current.MainWindow.ShowChildWindowAsync(childWindow);
PS: am using SimpleChildWindow version 1.5 with MahApps 1.6.5
The Loaded event fires when an element becomes part of the visual tree. Depending where your element is, this can happen more than once. Also an application might have to recreate its visual tree.
when calling ShowChildWindowAsync() my ContentControl Loaded event gets called twice ... it does not suppose to do that.
PS: am using SimpleChildWindow version 1.5 with MahApps 1.6.5