Open seanocali opened 3 years ago
I agree there isn't a strong need to have the getter be protected. Having a public getter might suggest more flexibility than the XamlCompositionBrushBase subclass might support, though. For example:
A public getter could still safely be used to check if the CompositionBrush has been set, or for a test to check if the right type and properties got set, though.
Good points. Plus if someone disposes the CompositionBrush before the XCBB is done with it I imagine that could be problematic. Maybe there could be a method to clone it? Something like:
Compositor.CreateBrushFromXaml(XamlCompositionBrushBase xamlBrush)
Cloning would solve the Close() issue, but not the "Complex XCBB classes" issue.
Proposal: [Make the getter for XamlCompositionBrushBase.CompositionBrush public]
Summary
I have custom controls that use CompositionBrushes internally but have XAML Brush dependency properties. I have written XAML Brush to CompositionBrush translations for solid and linear gradient, but not for acrylic or anything else that comes along.
Rationale
I can't think of any dangers to making access to the getter public.