Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>myGrid.BitmapEffect = null; </code></pre> <p>PS: Note that <a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement.bitmapeffect.aspx" rel="nofollow noreferrer">BitmapEffect</a> is considered obsolete and that <a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement.effect.aspx" rel="nofollow noreferrer">Effect</a> should be used instead.</p> <hr> <p>Here's an example based on your sample which works perfectly fine (here on my machine): As soon as I click within the Grid, the effect disappears.</p> <p>XAML:</p> <pre><code>&lt;Window x:Class="WpfCsApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"&gt; &lt;Grid Background="#FFE5AA" Margin="10" MouseDown="Grid_MouseDown" x:Name="myGrid"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="62*"/&gt; &lt;RowDefinition Height="15*"/&gt; &lt;RowDefinition Height="23*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.BitmapEffect&gt; &lt;OuterGlowBitmapEffect GlowColor="#459E5A" GlowSize="13" Noise="0" Opacity="0.9" /&gt; &lt;/Grid.BitmapEffect&gt; &lt;Border Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" BorderBrush="#F5B903" BorderThickness="1,1,1,1" &gt; &lt;TextBlock&gt;Test&lt;/TextBlock&gt; &lt;/Border&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre> <p>Codebehind:</p> <pre><code>public partial class Window1 : Window { public Window1() { InitializeComponent(); } private void Grid_MouseDown(object sender, MouseButtonEventArgs e) { myGrid.BitmapEffect = null; } } </code></pre> <hr> <p>In your example you write: <code>//there i want to change Control1.BitmapEffect</code>. Note that you need to change the BitmapEffect of the <em>Grid</em>, not the BitmapEffect of <em>Control1</em>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload