Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - StackPanel.Triggers issue

 
 
Old 05-31-2006   #1 (permalink)
Vipin [MVP]


 
 

StackPanel.Triggers issue

The below XAML from the sdk doesn't work, the error it
throws is "Error 7 The attached property 'StackPanel.Triggers' is not
defined on 'Rectangle' or one of its base classes. Line 8 Position 16."


<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SDKSample.ControlStoryboard"
WindowTitle="Controlling a Storyboard" >
<StackPanel Margin="20" >

<!-- This rectangle is animated. -->
<Rectangle Name="myRectangle"
Width="100" Height="20" Margin="12,0,0,5" Fill="#AA3333FF"
HorizontalAlignment="Left" />

<!-- This StackPanel contains all the Buttons. -->
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">

<Button Name="BeginButton">Begin</Button>
<Button Name="PauseButton">Pause</Button>
<Button Name="ResumeButton">Resume</Button>
<Button Name="SkipToFillButton">Skip To Fill</Button>
<Button Name="SetSpeedRatioButton">Triple Speed</Button>
<Button Name="StopButton">Stop</Button>

<StackPanel.Triggers>

<!-- Begin the Storyboard -->
<EventTrigger RoutedEvent="Button.Click" SourceName="BeginButton">
<BeginStoryboard Name="MyBeginStoryboard">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="myRectangle"
Storyboard.TargetProperty="(Rectangle.Width)"
Duration="0:0:5" From="100" To="500" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>

<!-- Pause the Storyboard -->
<EventTrigger RoutedEvent="Button.Click" SourceName="PauseButton">
<PauseStoryboard BeginStoryboardName="MyBeginStoryboard" />
</EventTrigger>

<!-- Resume the Storyboard -->
<EventTrigger RoutedEvent="Button.Click" SourceName="ResumeButton">
<ResumeStoryboard BeginStoryboardName="MyBeginStoryboard" />
</EventTrigger>

<!-- Skip to Fill -->
<EventTrigger RoutedEvent="Button.Click"
SourceName="SkipToFillButton">
<SkipStoryboardToFill BeginStoryboardName="MyBeginStoryboard" />
</EventTrigger>

<!-- Stop the Storyboard -->
<EventTrigger RoutedEvent="Button.Click" SourceName="StopButton">
<StopStoryboard BeginStoryboardName="MyBeginStoryboard" />
</EventTrigger>

<!-- Triple the speed of the Storyboard -->
<EventTrigger RoutedEvent="Button.Click"
SourceName="SetSpeedRatioButton">
<SetStoryboardSpeedRatio SpeedRatio="3"
BeginStoryboardName="MyBeginStoryboard" />
</EventTrigger>
</StackPanel.Triggers>
</StackPanel>
</StackPanel>
</Page>


--
Vipin Aravind
http://www.explorewindows.com




My System SpecsSystem Spec
Old 06-01-2006   #2 (permalink)
Michael Jacobs [MSFT]


 
 

Re: StackPanel.Triggers issue

The sample works for me on beta 2 bits. I was able to compile and run it,
and I was also able to run it in XAML pad after removing the
x:Class="SDKSample.ControlStoryboard" declaration. Are you using Beta 2
bits?

- Mike Jacobs [MS]




"Vipin [MVP]" <Vipin@nospam.com> wrote in message
news:uGxCX3ShGHA.5088@TK2MSFTNGP02.phx.gbl...
> The below XAML from the sdk doesn't work, the error it
> throws is "Error 7 The attached property 'StackPanel.Triggers' is not
> defined on 'Rectangle' or one of its base classes. Line 8 Position 16."
>
>
> <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
> x:Class="SDKSample.ControlStoryboard"
> WindowTitle="Controlling a Storyboard" >
> <StackPanel Margin="20" >
>
> <!-- This rectangle is animated. -->
> <Rectangle Name="myRectangle"
> Width="100" Height="20" Margin="12,0,0,5" Fill="#AA3333FF"
> HorizontalAlignment="Left" />
>
> <!-- This StackPanel contains all the Buttons. -->
> <StackPanel Orientation="Horizontal" Margin="0,30,0,0">
>
> <Button Name="BeginButton">Begin</Button>
> <Button Name="PauseButton">Pause</Button>
> <Button Name="ResumeButton">Resume</Button>
> <Button Name="SkipToFillButton">Skip To Fill</Button>
> <Button Name="SetSpeedRatioButton">Triple Speed</Button>
> <Button Name="StopButton">Stop</Button>
>
> <StackPanel.Triggers>
>
> <!-- Begin the Storyboard -->
> <EventTrigger RoutedEvent="Button.Click" SourceName="BeginButton">
> <BeginStoryboard Name="MyBeginStoryboard">
> <Storyboard>
> <DoubleAnimation
> Storyboard.TargetName="myRectangle"
> Storyboard.TargetProperty="(Rectangle.Width)"
> Duration="0:0:5" From="100" To="500" />
> </Storyboard>
> </BeginStoryboard>
> </EventTrigger>
>
> <!-- Pause the Storyboard -->
> <EventTrigger RoutedEvent="Button.Click" SourceName="PauseButton">
> <PauseStoryboard BeginStoryboardName="MyBeginStoryboard" />
> </EventTrigger>
>
> <!-- Resume the Storyboard -->
> <EventTrigger RoutedEvent="Button.Click" SourceName="ResumeButton">
> <ResumeStoryboard BeginStoryboardName="MyBeginStoryboard" />
> </EventTrigger>
>
> <!-- Skip to Fill -->
> <EventTrigger RoutedEvent="Button.Click"
> SourceName="SkipToFillButton">
> <SkipStoryboardToFill BeginStoryboardName="MyBeginStoryboard" />
> </EventTrigger>
>
> <!-- Stop the Storyboard -->
> <EventTrigger RoutedEvent="Button.Click" SourceName="StopButton">
> <StopStoryboard BeginStoryboardName="MyBeginStoryboard" />
> </EventTrigger>
>
> <!-- Triple the speed of the Storyboard -->
> <EventTrigger RoutedEvent="Button.Click"
> SourceName="SetSpeedRatioButton">
> <SetStoryboardSpeedRatio SpeedRatio="3"
> BeginStoryboardName="MyBeginStoryboard" />
> </EventTrigger>
> </StackPanel.Triggers>
> </StackPanel>
> </StackPanel>
> </Page>
>
>
> --
> Vipin Aravind
> http://www.explorewindows.com
>
>
>



My System SpecsSystem Spec
Old 06-01-2006   #3 (permalink)
Vipin [MVP]


 
 

Re: StackPanel.Triggers issue

I just upgraded to the latest beta2 version of winfx and sdk and it is fine
over there
As you mentioned, had to remove the x:Class.

--
Vipin Aravind
http://www.explorewindows.com


"Michael Jacobs [MSFT]" <mijacobs@online.microsoft.com> wrote in message
news:u0s586ZhGHA.4648@TK2MSFTNGP02.phx.gbl...
> The sample works for me on beta 2 bits. I was able to compile and run it,
> and I was also able to run it in XAML pad after removing the
> x:Class="SDKSample.ControlStoryboard" declaration. Are you using Beta 2
> bits?
>
> - Mike Jacobs [MS]
>
>
>
>
> "Vipin [MVP]" <Vipin@nospam.com> wrote in message
> news:uGxCX3ShGHA.5088@TK2MSFTNGP02.phx.gbl...
>> The below XAML from the sdk doesn't work, the error it
>> throws is "Error 7 The attached property 'StackPanel.Triggers' is not
>> defined on 'Rectangle' or one of its base classes. Line 8 Position 16."
>>
>>
>> <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>> x:Class="SDKSample.ControlStoryboard"
>> WindowTitle="Controlling a Storyboard" >
>> <StackPanel Margin="20" >
>>
>> <!-- This rectangle is animated. -->
>> <Rectangle Name="myRectangle"
>> Width="100" Height="20" Margin="12,0,0,5" Fill="#AA3333FF"
>> HorizontalAlignment="Left" />
>>
>> <!-- This StackPanel contains all the Buttons. -->
>> <StackPanel Orientation="Horizontal" Margin="0,30,0,0">
>>
>> <Button Name="BeginButton">Begin</Button>
>> <Button Name="PauseButton">Pause</Button>
>> <Button Name="ResumeButton">Resume</Button>
>> <Button Name="SkipToFillButton">Skip To Fill</Button>
>> <Button Name="SetSpeedRatioButton">Triple Speed</Button>
>> <Button Name="StopButton">Stop</Button>
>>
>> <StackPanel.Triggers>
>>
>> <!-- Begin the Storyboard -->
>> <EventTrigger RoutedEvent="Button.Click" SourceName="BeginButton">
>> <BeginStoryboard Name="MyBeginStoryboard">
>> <Storyboard>
>> <DoubleAnimation
>> Storyboard.TargetName="myRectangle"
>> Storyboard.TargetProperty="(Rectangle.Width)"
>> Duration="0:0:5" From="100" To="500" />
>> </Storyboard>
>> </BeginStoryboard>
>> </EventTrigger>
>>
>> <!-- Pause the Storyboard -->
>> <EventTrigger RoutedEvent="Button.Click" SourceName="PauseButton">
>> <PauseStoryboard BeginStoryboardName="MyBeginStoryboard" />
>> </EventTrigger>
>>
>> <!-- Resume the Storyboard -->
>> <EventTrigger RoutedEvent="Button.Click"
>> SourceName="ResumeButton">
>> <ResumeStoryboard BeginStoryboardName="MyBeginStoryboard" />
>> </EventTrigger>
>>
>> <!-- Skip to Fill -->
>> <EventTrigger RoutedEvent="Button.Click"
>> SourceName="SkipToFillButton">
>> <SkipStoryboardToFill BeginStoryboardName="MyBeginStoryboard" />
>> </EventTrigger>
>>
>> <!-- Stop the Storyboard -->
>> <EventTrigger RoutedEvent="Button.Click" SourceName="StopButton">
>> <StopStoryboard BeginStoryboardName="MyBeginStoryboard" />
>> </EventTrigger>
>>
>> <!-- Triple the speed of the Storyboard -->
>> <EventTrigger RoutedEvent="Button.Click"
>> SourceName="SetSpeedRatioButton">
>> <SetStoryboardSpeedRatio SpeedRatio="3"
>> BeginStoryboardName="MyBeginStoryboard" />
>> </EventTrigger>
>> </StackPanel.Triggers>
>> </StackPanel>
>> </StackPanel>
>> </Page>
>>
>>
>> --
>> Vipin Aravind
>> http://www.explorewindows.com
>>
>>
>>

>
>



My System SpecsSystem Spec
 

Thread Tools



Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46