Ok, so this is just an idea I have floating in my head regarding a sort of 'pseudo-write--only' dependency property. I say sort of because I actually don't even want the value to be stored, but rather I want the value I pass to the setter to set other properties. As a hypothetical example, I'd like to do this...
<button UIHelper.Bounds="10,10,40,20" />
instead of this...
<button Canvas.Left="10" Canvas.Top="10" Width="40" Height="20" />
Just a XAML-typing convenience thing that lets me set the actual four properties with something easier to type thanks to say a write-only attached property. Think along the way of collapsed CSS rules. Actually, to that effect, here's another...
<border UIHelper.BrushSpec="AliceBlue Red 2 4" />
instead of...
<border Background="AliceBlue" BorderBrush="Red" BorderThickness="2" CornerRadius="4" />
Now using the first as an example, one idea is to store such a structure internally, then sync it with the existing Width, Height, Canvas.Left and Canvas.Top properties, but I really don't ever plan on reading it back out so that isn't needed. (Technically I could ignore the storing of it altogether and just call ClearValue in the propertychanged handler but again, it's not really for reading it back out so that's just for consistency.)
Technically I don't even want/need this to be a DP except my understanding is if you need to set it from XAML, it has to be a DP, hence what I'm after. It would be perfect if we could just set a straight-up .NET property as I could make the implementation both set, and reconstruct itself as needed, but again, I understand you can't access .NET properties from XAML, hence I'm right back here.
Now yes I know this concept will be frowned upon by a lot of people, especially the XAML purists, but I'm asking how not why so if for no other reason, consider this an exercise in 'can it be done' not 'should it be done'. I'm not even suggesting this is what I'll use. I'm just trying to better understand the limits of DPs and XAML and I find exercises like this to be really helpful.
So, thoughts??
M