![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| Thread Tools | |
| |