1
Viewmodel özelliklerinden birini DropShadowEffect'in rengine bağlamak istiyorum. Bin çeşit varyasyon denedim ama hiçbiri işe yaramadı.DropShadowEffect Renk ciltleme çalışmıyor
stili:
<Style TargetType="{x:Type Image}" x:Key="CentralImageStyle">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect ShadowDepth="0"
Color="{Binding Path=DataContext.CurrentPlayer.Character, Converter={StaticResource CharacterColorConverter},
RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
Opacity="1" BlurRadius="50"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
Kontrol:
<Image Source="{Binding CurrentPlayer.BackImageSource}"
Style="{DynamicResource ResourceKey=CentralImageStyle}">
ve dönüştürücü:
switch ((string)value)
{
case "char1":
return new SolidColorBrush(Colors.WhiteSmoke);
case "char2":
return new SolidColorBrush(Colors.Red);
default:
return new SolidColorBrush(Colors.White);
}
Benim sorunum DropShadowEffect rengi siyah olmasıdır. Bu, dönüştürücünün kullanılmadığı anlamına gelir.
Teşekkürler, bu benim sorunumu çözdü. –