wpf - Why can I not set a SolidColorBrush resource value from code? -
i have resource defined in xaml :
<core:widgetbase xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" x:class="....silverlight.liquidityconstraintsview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:core="clr-namespace:...silverlight;assembly=....silverlight" xmlns:local="clr-namespace:....silverlight" mc:ignorable="d"> <core:widgetbase.resources> <solidcolorbrush x:key="..." /> </core:widgetbase.resources> ... i trying set code :
void _administrationclient_getbyfiltermodulesettingcompleted(object sender, getbyfiltermodulesettingcompletedeventargs e) { this.resources["..."] = new solidcolorbrush(colors.red); } but error :
the method or operation not implemented.
stack trace :
@ system.windows.resourcedictionary.set_item(object key, object value) @ ....silverlight.liquidityconstraintsview._administrationclient_getbyfiltermodulesettingcompleted(object sender, getbyfiltermodulesettingcompletedeventargs e) @ ....service.administrationserviceclient.ongetbyfiltermodulesettingcompleted(object state) it happens when send off request server fetch me colour, when returns try , set colour resource, fails if try , set red @ point.
if @ helps, method in setting async callback method wcf call server.
if @ setter resourcedictionary in reflector (for silverlight), you'll see throws notimplementedexception, not work in silverlight.
you try removing resource , re-adding it, that's shot in dark.
Comments
Post a Comment