<Grid> ... </Grid>
및 Grid.BitmapEffect 속성과 같은 사용자 지정 컨트롤 유형이 있습니다. C# 코드 (예 : 이벤트)를 통해이 컨트롤 (그리드)에서 BitmapEffetc를 어떻게 변경합니까?C# 코드를 통해 사용자 지정 WPF 컨트롤에서 BitmapEffect를 변경하는 방법
코드 샘플 - 사용자 지정 컨트롤의 일부 : Window.xaml에서 다음
[...]
<Grid Background="#FFE5AA">
<Grid.RowDefinitions>
<RowDefinition Height="62*"/>
<RowDefinition Height="15*"/>
<RowDefinition Height="23*"/>
</Grid.RowDefinitions>
<Grid.BitmapEffect>
<OuterGlowBitmapEffect GlowColor="#459E5A" GlowSize="13" Noise="0" Opacity="0.9" />
</Grid.BitmapEffect>
<Border Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" BorderBrush="#F5B903" BorderThickness="1,1,1,1" >
</Border>
[...]
:
<controls:MyControl Name="Control1" Cursor="Hand" MouseDown="Control1_MouseDown" />
그리고 C#에서 :
private void Control1_MouseDown(object sender, MouseButtonEventArgs e)
{
//there i want to change Control1.BitmapEffect
}
효과가 없습니다. – Kamilos
방금 해봤지만 제대로 작동합니다. 문제를 재현 할 수있는 간단한 예를 제공 할 수 있습니까? – Heinzi
좋습니다. – Kamilos