-
Notifications
You must be signed in to change notification settings - Fork 981
Description
Feature Suggestion
At this time, WPF version of ScottPlot uses UserControl.
This introduce some limitations:
-
Appearance of an
UserControlcannot be changed using aTemplate. Even though it has a property forTemplate, but it is of no use, as you cannot change the appearance ofUserControlthrough this property. -
UserControlis derived fromContentControl, thus if you change the content of anUsercontrolthe entire UI will be replaced with that content. -
As
UserControlhas bothXAMLand code behind. But asXAMLcan be used only once for entire inheritance hierarchy, you cannot useXAMLfor any class that inherits from yourUserControl. This is actually becauseApplication.LoadComponentloads up theXAMLonce and is incompatible with inheritance. Thus when loading theXAML, theIComponentConnectorinterface is used to hook events and fields fromXAML, hence you cannot replaceXAMLfrom your base class.
I would like to change this to use CustomControl, this would remove those limitation.
Feature description:
As the ScottPlot WPF control is quiet simple this is not a big deal to achieve, I have already did it locally because I need it for my application.
This way, I can specialize the "base" control for example to add support for Crossbar, and not have to copy/past the crossbar code on each view on which I use it (I am a lazy developer ;-) )
I have also changed the events to use RoutedEvent instead of event, to be able to use them on XAML side.
If there is any interest about this, I could submit my changes as PR (need to learn how to do it, it would be my first PR!)
Best regards
Fabrice