Closed samirem closed 1 year ago
You've lost the error template along the way. I think you should be able to include this in a generic.xaml for the assembly, which then provides a default style for the control. The whole concept is a bit underdocumented, admittedly.
If the error message could be rendered in the same DrawingContext, you could lose the template as well and probably go with a FrameworkElement as base class.
Also I'm not quite sure whether it's a good idea to render the control into a dummy DrawingContext just to measure it; perhaps not rendering is cheaper, even if it incurs font metric calculations, but at least you don't have to render text you never need.
I am so sorry this took me some time to get to review. It somehow slipped through my mailbox. I'll take a closer look in the next few days.
Could you please give an example of how you would like to use/override the default style?
I am concerned by the fact that this introduces several breaking changes into the library, and I'd like to get a code example to play with and maybe figure out if it's possible to do in a less breaking way, or is it worth to introduce a compatibility layer.
Without explanations, I'm sorry, I have to decline this for now. I don't understand the issue, and I don't understand how to check that the issue is resolved.
This should fix #97.
Instead of inheriting from
UserControl
, theFormulaControl
now inherits fromControl
, and overrides theDefaultStyleKey
. I also had to overrideMeasureOverride
, and compute the size of the control by making some minor modifications to other classes.