microsoft / XamlBehaviorsWpf

Home for WPF XAML Behaviors on GitHub.
MIT License
852 stars 140 forks source link

OnDetaching function is never called #140

Closed wobushiafa closed 11 months ago

wobushiafa commented 1 year ago

when i close the window,OnDetaching is not called

brianlagunas commented 11 months ago

This is expected. OnDetaching only gets called when a behavior is removed from the Behaviors collection. When you close a window, this does not remove the behavior from the collection.