wpf - Modifying a resource in C#? -
i have resource (mypoint) defined in xaml follows: <path name="mypath"> <path.resources> <point x:key="mypoint" x="200" y="200"/> </path.resources> </path> in onapplytemplate override in corresponding c# code, use following reference resource. mypointreference = (point)mypath.findresource("mypoint"); now, whenever modify value of mypointreference, let's say, mypointreference.x = 30; it doesn't modify value of resource mypoint, changes value of mypointreference. how can make mypointreference actual reference xaml defined resource mypoint when modify value of mypointreference, modifying value of mypoint? under covers when use resources extension in xaml dealing resourcedictionary , dealing adding struct (aka value type) passed value (aka copied) dictionary, , when request returned copy. there no way pass value types reference when dealing resourcedictionary. ...