내 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>
...
코드에서 설정하려고합니다.
void _administrationClient_GetByFilterModuleSettingCompleted(object sender, GetByFilterModuleSettingCompletedEventArgs e)
{
this.Resources["..."] = new SolidColorBrush(Colors.Red);
}
하지만 오류가 발생합니다.
방법 또는 작업이 구현되지 않았습니다.
스택 추적 :
at System.Windows.ResourceDictionary.set_Item(Object key, Object value)
at ....Silverlight.LiquidityConstraintsView._administrationClient_GetByFilterModuleSettingCompleted(Object sender, GetByFilterModuleSettingCompletedEventArgs e)
at ....Service.AdministrationServiceClient.OnGetByFilterModuleSettingCompleted(Object state)
색상을 가져 오라는 요청을 서버에 보낸 다음 반환되면 해당 색상을 리소스에 설정하려고 시도하면 그 시점에서 빨간색으로 설정해도 실패합니다.
그것이 도움이된다면, 이것을 설정하는 방법은 WCF 호출에서 서버로의 비동기 콜백 메서드입니다.
ResourceDictionary
Reflector (Silverlight 용) 에서에 대한 setter를 보면를 던지는 것을 볼 수 NotImplementedException
있으므로 Silverlight에서는 작동하지 않습니다.
리소스를 제거하고 다시 추가해 볼 수 있지만 이는 어둠 속에서 촬영 한 것입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다