I need to bind to static properties in my App.xaml.cs class and have so far done this using:
Property="{Binding Source={x.Static Application.Current}, Path=SomePath}"
This works OK when the application is being run directly, but when the application is started from another application, these bindings don’t work as I believe Application.Current then points at the parent application rather than the application that the xaml sits under.
How would I bind to the immediate App.xaml.cs file properties rather than those from the parent application?
Hope that makes sense!
So one solution I’ve found so far is to put a class between App.xaml.cs and the XAML I’m trying to bind:
App.xaml.cs:
MyProperties.cs:
MainWindow.xaml:
Any other suggestions are still more than welcome 🙂