DrawingBrush drwBrush = Mystyles[myDrawing] as DrawingBrush;drwBrush.SetValue(MyProperties.InternalSolidBrushProperty, Mystyles[keySolidBrush]);
<DrawingBrush x:Key="SymbolLock2" Stretch="Uniform" custom:MyProperties.InternalSolidBrush="{StaticResource SolidBrushOver}" Drawing="{Binding Source={StaticResource SymbolLock},Path=Drawing}"/>
// DependencyProperty public static readonly DependencyProperty InternalSolidBrushProperty;
<DrawingBrush x:Key="SymbolLock" Stretch="Uniform"custom:MyProperties.InternalSolidBrush="{StaticResourceSolidBrushIconMenuSecondary}"> <DrawingBrush.Drawing> <DrawingGroup> <DrawingGroup.Children>...... <GeometryDrawing Brush="{BindingPath=(custom:MyProperties.InternalSolidBrush),RelativeSource={RelativeSource FindAncestor, AncestorType={x:TypeDrawingBrush}}}" Geometry="F1 M 35.0118,21.7446L 33.5068,21.7446L33.5025,14.4511C 33.4983,6.47188 27.0361,0.0047454819.0556,-1.52588e-005C 11.071,0.00474548 4.60764,6.471884.60335,14.4511L 4.60335,21.7446L 3.09834,21.7446C 1.38731,21.74467.62939e-006,23.1342 7.62939e-006,24.8459L 7.62939e-006,42.9929C7.62939e-006,44.707 1.38731,46.0967 3.09834,46.0967L 35.0118,46.0967C36.7276,46.0967 38.1155,44.707 38.1155,42.9929L 38.1155,24.8459C38.1155,23.1342 36.7276,21.7446 35.0118,21.7446 Z M 10.5533,14.4511C10.5659,9.75938 14.3586,5.96257 19.0556,5.95174C 23.748,5.9625727.5484,9.75938 27.5532,14.4511L 27.5532,21.7446L 10.5533,21.7446L10.5533,14.4511 Z "/> </DrawingGroup.Children> </DrawingGroup> </DrawingBrush.Drawing> </DrawingBrush>