.net - Restyling just part of a wpf control. Is it possible? -
I just want to restyle part of a WPF control.
(Especially, I scrollbar big scroll button)
Now I can not make any problems with this. I created default tweaks to remove the default style and my application included modified style.
The problem is that I include the entire control template in the replacement style, when I am changing the value is 2.
& lt; Setter Property = "Control. Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "ScrollBar" & gt; & Lt; Grid Background = "{TemplateBinding Panel.Background}" SnapsToDevicePixels = "True" & gt; & Lt; Grid.ColumnDefinitions & gt; & Lt; Column definition MaxWide = "{dynamic resource {x: static system parameter horizontal scarler button button}}" /> & Lt; Column define width = "1E05 *" /> & Lt; Column definition MaxWide = "{dynamic resource {x: static system parameter horizontal scarler button button}}" /> & Lt; / ... etc
I want to change MaxWith to 50 on the definitions of the column.
So my question is this: Is there any way i can tweak this template without having to include everything? I still want to work all the parts of the control template as default.
In this case, because you get the value from a resource and grabs it: / P>
& lt; ScrollBar xmlns: sys = "clr-namespace: system; assembly = mscorlib" & gt; & Lt; ScrollBar.Resources & gt; & Lt; Sys: Double X: Key = "{x: Static System Parameter. Horizontal Circle BarburtonWidth}" & gt; 50 & lt; / Sy: Double & gt; & Lt; /ScrollBar.Resources> & Lt; / Scrollbar & gt;
If the template was hard-coded, then you would be out of luck.
Comments
Post a Comment