firstfloorsoftware / mui

Modern UI for WPF
Microsoft Public License
2.6k stars 755 forks source link

How to connect RoutedEvent from modernUI page to parent window? #167

Open coopersnick opened 7 years ago

coopersnick commented 7 years ago

Hi Guys,

I have a simple scenario - I have a UserControl that is hosted inside a "modernTab" page all inside my modern UI themed WPF app.

From this user control I want to fire a "RoutedEvent", bubble it up the logical tree and catch it - then I just want to handle it at that level, to control other aspects of the app. Here and Here describe what I mean with the routed event.

However, because in mui, you don't have to declare a lot of your own XAML, I can't see how to refer down the logical tree that is created to subscribe to the event. MUI is handling setting all that up - I just populate "" and the rest of the constructions is handled for me.

So - is there some guidance on how I can look down the tree and register a handler for a UserControl inside a modern Tab? Or some other way of dealing with events propagated up the tree?