XAML properties values overwritten by the PlotModel

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

Gimly wrote at 2014-02-03 11:52:

Hello,

I was wondering about something a bit annoying when using the PlotModel in a MVVM scenario.

As the library is now, the PlotModel values overwrites all properties values that are defined directly in the XAML. This means that, when using the PlotModel, no properties can be set in the XAML.

This is annoying, because it means that some UI stuff must be set in the VM (where the PlotModel is setup).

I'm currently defining my PlotModel in my VM because it's too complex to be defined in the XAML only (dynamic number of series mostly). Even though this is a necessity for me, I still would like to define some things from the XAML.

For example, I would like to set a specific font for the Title of the plot. This is typically a UI stuff that my VM should have no knowledge about. Unfortunately, if I set it up in my XAML, it is overwritten by the default value when the biding of the PlotModel kicks-in.

So, my question, would it be possible to, when using XAML and databinding, prioritize the value set in the XAML (if it has been re-defined) over the value in the PlotModel?

Hope this is clear enough.

Thanks,
Gimly

objo wrote at 2014-02-04 19:20:

Good idea, added to https://oxyplot.codeplex.com/workitem/10128
Should not be very difficult to implement, I think.