Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I realized hides the border in such a way:</p> <p>Style:</p> <pre><code>&lt;Style x:Key="NotificationStyle" TargetType="{x:Type Border}"&gt; &lt;Style.Triggers&gt; &lt;Trigger Property="Visibility" Value="Visible"&gt; &lt;Trigger.EnterActions&gt; &lt;BeginStoryboard&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Storyboard.TargetProperty="Opacity" BeginTime="0:0:0" From="0.0" To="1.0" Duration="0:0:1.0" /&gt; &lt;DoubleAnimation Storyboard.TargetProperty="Opacity" BeginTime="0:0:5" From="1.0" To="0.0" Duration="0:0:1.0" /&gt; &lt;/Storyboard&gt; &lt;/BeginStoryboard&gt; &lt;/Trigger.EnterActions&gt; &lt;/Trigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; </code></pre> <p>Grid:</p> <pre><code>&lt;Grid&gt; &lt;Border Name="MyBorder" Width="100" Visibility="Hidden" Height="50" BorderThickness="2" BorderBrush="OrangeRed" Style="{StaticResource NotificationStyle}"&gt; &lt;TextBlock Text="Some information" TextAlignment="Center" VerticalAlignment="Center" /&gt; &lt;/Border&gt; &lt;ToggleButton Name="MyButton" Content="Show border" Width="100" Height="30" VerticalAlignment="Bottom" Click="Button_Click" /&gt; &lt;/Grid&gt; </code></pre> <p>In code:</p> <pre><code>private void Button_Click(object sender, RoutedEventArgs e) { if (MyButton.IsChecked == true) { MyBorder.Visibility = System.Windows.Visibility.Visible; } if (MyButton.IsChecked == false) { MyBorder.Visibility = System.Windows.Visibility.Hidden; } } </code></pre> <p>From his experiments I understood that if the property was once used in animation, then working with it is only possible from the animation-triggers. Accordingly, the access code of the property I have not received. </p> <p>Besides, then the control's used Visibility=Collapsed, he it does not receive messages from the system and the animation will not work. Although a property "Hidden" should take messages, but I have not worked as well as animation, so in example I used <strong>opacity</strong>.</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