Note that there are some explanatory texts on larger screens.

plurals
  1. POStoryboard animation based on control template's control property
    primarykey
    data
    text
    <p>This is what I have </p> <ol> <li>A ControlTemplate for a button in my window.resource, having an ellipse with an outerglow (named -- <em>TasksToggleButtonOuterGlowBitmapEffect</em>) and a text</li> <li>A button that is using this template</li> </ol> <p>This is what I need</p> <p><strong>1. A storyboard that operates on the outerglow of the above mentioned ellipse 2. I shall trigger this storyboard from my codebehind file at any moment</strong></p> <p>When I tried this with the following snippet, the framework gives me a runtime exception stating that it is not able to find the control, <em>TasksToggleButtonOuterGlowBitmapEffect</em></p> <pre><code>&lt;Window.Resource&gt; &lt;ControlTemplate x:Key="DefaultTasksToggleButtonTemplate" TargetType="ToggleButton"&gt; &lt;Grid Margin="2"&gt; &lt;Border BorderBrush="White" BorderThickness="2" CornerRadius="20"&gt; &lt;Border.BitmapEffect&gt; &lt;OuterGlowBitmapEffect x:Name="TasksToggleButtonOuterGlowBitmapEffect" GlowColor="LightGray" /&gt; &lt;/Border.BitmapEffect&gt; &lt;/Border&gt; &lt;Ellipse Fill="Red" Width="20" Height="20" Margin="2" /&gt; &lt;ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /&gt; &lt;/Grid&gt; &lt;/ControlTemplate&gt; &lt;Storyboard x:Key="GlowStoryboard"&gt; &lt;DoubleAnimation Storyboard.TargetName="TasksToggleButtonOuterGlowBitmapEffect" Storyboard.TargetProperty="GlowSize" From="5" To="10" /&gt; &lt;/Storyboard&gt; &lt;/Window.Resources&gt; </code></pre> <p>Update -- I want this to be in the resource so that any button can use it</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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