Click here to Skip to main content
15,908,675 members

Comments by RenZan (Top 3 by date)

RenZan 15-Aug-12 2:09am View    
Maybe I didn't express well, I meens when the "Completed" event of Storyboard happening, I want do something in the procedure codes(.cs), such as, if I don't use control template, just use the normal control, .xaml codes as below(sorry I don't know how to dispaly the angle brackets):
Window x:Class="ControlTemplateEvents.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"
Grid x:Name="theGrid" Width="50" Height="50" Background="LightBlue"
Grid.Triggers
EventTrigger RoutedEvent="Grid.MouseEnter"
BeginStoryboard
Storyboard Completed="Storyboard_Completed"
DoubleAnimation Storyboard.TargetName="theGrid" Storyboard.TargetProperty="Height"
To="100" Duration="0:0:1"/
/Storyboard
/BeginStoryboard
/EventTrigger
/Grid.Triggers
/Grid
/Window
and the .cs codes as below:
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}

private void Storyboard_Completed(object sender, EventArgs e)
{
MessageBox.Show("Completed!");
}
}
when the storyboard is completed, I can show the message.
how can I do this in a control template?
thank you very much!
RenZan 15-Aug-12 2:04am View    
Deleted
sorry, the xaml part is fail to display, it is as below:
<pre lang="xml">
<window x:class="ControlTemplateEvents.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">
<grid x:name="theGrid" width="50" height="50" removed="LightBlue">
<grid.triggers>
<eventtrigger routedevent="Grid.MouseEnter">
<beginstoryboard>
<storyboard completed="Storyboard_Completed">
<doubleanimation storyboard.targetname="theGrid" storyboard.targetproperty="Height"
="" to="100" duration="0:0:1">






</pre>
RenZan 15-Aug-12 2:02am View    
Deleted
Maybe I didn't express well, I meens when the "Completed" event of Storyboard happening, I want do something in the procedure codes(.cs), such as, if I don't use control template, just use the normal control:
<window x:class="ControlTemplateEvents.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">
<grid x:name="theGrid" width="50" height="50" removed="LightBlue">
<grid.triggers>
<eventtrigger routedevent="Grid.MouseEnter">
<beginstoryboard>
<storyboard completed="Storyboard_Completed">
<doubleanimation storyboard.targetname="theGrid" storyboard.targetproperty="Height"
="" to="100" duration="0:0:1">






and the .cs part:
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}

private void Storyboard_Completed(object sender, EventArgs e)
{
MessageBox.Show("Completed!");
}
}
when the storyboard is completed, I can show the message.
how can I do this in a control template?
thank you very much!