I have a UserControl (and background ViewModel) that I use across multiple projects – it’s quite generic. Inevitably, in one project I have to modify it slightly to show an extra command (preferably as an extra button in the grids context menu, but if need be just an extra button). How can I implement this but keep the class generic?
edit: I’m aware of patterns like dependency injection in C#, but when it comes to xaml I don’t know how to proceed. So as well as specific ways to accomplish this I’m also after possible design options.
If more details are required let me know.
Thanks
To have some form of reuse I broke down the generic xaml page into usercontrols, built a specific xaml page and referenced the generic usercontrols where possible. It’s not what I wanted to do, but it’s better than a completely new xaml page for every instance.