次のようなカスタム コントロール タイプ<Grid> ... </Grid>
と Grid.BitmapEffect プロパティがあります。このコントロール (グリッド) の BitmapEffetc を C# コード (イベントなど) で変更するにはどうすればよいですか?
コード サンプル - カスタム コントロールの一部:
[...]
<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>
[...]
次に Window.xaml で:
<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
}