windows runtime - How to update ThemeResource on DependencyObject? -
i have following viewmodel object:
public class imagecontent : dependencyobject { public static readonly dependencyproperty imageproperty = dependencyproperty.register("image", typeof(imagesource), typeof(imagecontent), new propertymetadata(null, imagepropertychanged)); private static void imagepropertychanged(dependencyobject d, dependencypropertychangedeventargs e) { } public imagesource image { { return (imagesource)getvalue(imageproperty); } set { setvalue(imageproperty, value); } } }
in xaml use content button this:
<button style="{staticresource calloptionbuttonstyle}"> <viewmodel:imagecontent image="{themeresource imgkeypad}"/> </button>
i noticed when change theme on windows phone 8.1 image on button not changed. imagepropertychanged not fired.
but if inherit object (for example) button, make same property , change theme imagepropertychanged fired.
are there explanations it? far see owning themeresource object should part of visualtree notification themeresource?
are there workarounds? how can receive notification in custom viewmodel inherited dependencyobject ?
Comments
Post a Comment