none
Cannot Resolve Target Name error-How to solve it?

    Question

  • I have a page named options.xaml. I have a storyboard inside it. I have a function in its code behind which will begin the story board.

    It work swell when I execute that page seperately.

    But when I add this file as a usercontrol inside another xaml file(page.xaml) and if I call that funtion inside options.xaml.cs from page.xaml.cs,

    I get an error like "Cannot Resolve Target Name" @ StoryBoard.Begin().

    Please help... 

     

     

     

    Tuesday, July 14, 2009 3:53 AM

All replies

  •  Hi,

    Do check all the names of the namespaces. Do post your xaml so that we can help.

    Tuesday, July 14, 2009 4:45 AM
  • I have highlighted the storyboard in Bold.  It work well when the page is executed seperately.

    But when I use the page as a usercontrol inside another xaml storyboard fails. 

     

    <Canvas>

     

    <Border Height="389" Width="487" x:Name="bdrMainCanvas" BorderBrush="#E6E6E6" BorderThickness="2" CornerRadius="2">

    <Border.Background>

    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

    <GradientStop Color="#FFD7D7D7" Offset="1"/>

    <GradientStop Color="#FFFFFFFF" Offset="0.121"/>

    <GradientStop Color="#FFD7D7D7" Offset="1.996"/>

    <GradientStop Color="#FFF6F3F3" Offset="0.996"/>

    </LinearGradientBrush>

    </Border.Background>

    <Canvas Height="389" Width="487" Background="Transparent" x:Name="cnvLoan">

    <TextBlock Text="MY" x:Name="tblMy" Canvas.Left="15" Canvas.Top="30" Style="{StaticResource TextBlockBlueHeaderStyle}" />

    <TextBlock Text="OPTIONS" x:Name="tblOptionMain" Canvas.Left="40" Canvas.Top="30" Style="{StaticResource TextBlockHeaderStyle}"/>

    <Path x:Name="pathOption1" Cursor="Hand" Width="80" Height="20" Fill="#FFC800" Canvas.Left="9" Canvas.Top="35" Stretch="Fill" Data="F1 M 0.179153,0.451431L 126.162,0.451431L 136.161,11.0889L 126.162,22.4514L 0.179153,22.4514L 0.179153,0.451431 Z " MouseLeftButtonDown="pathOption1_MouseLeftButtonDown" />

    <Path x:Name="pathOption2" Width="80" Height="20" Canvas.Left="84" Canvas.Top="35" Stretch="Fill" Fill="#FF363636" Data="F1 M 0.346375,0.411407L 100.329,0.411407L 110.328,11.0489L 100.329,22.4114L 0.346375,22.4114L 10.3463,11.1L 0.346375,0.411407 Z " MouseLeftButtonDown="pathOption2_MouseLeftButtonDown"/>

    <Path x:Name="pathOption3" Width="80" Height="20" Canvas.Left="158" Canvas.Top="35" Stretch="Fill" Fill="#FF363636" Data="F1 M 0.346375,0.411407L 100.329,0.411407L 110.328,11.0489L 100.329,22.4114L 0.346375,22.4114L 10.3463,11.1L 0.346375,0.411407 Z " MouseLeftButtonDown="pathOption3_MouseLeftButtonDown"/>

    <Path x:Name="pathOption1Glossy" Cursor="Hand" Width="80" Height="9.61334" Canvas.Left="9" Canvas.Top="35" Stretch="Fill" Fill="#5AFFFFFF" Data="F1 M 0.272736,0.259155L 125.852,0.259216L 135.314,9.8725L 0.272583,9.87244L 0.272736,0.259155 Z " MouseLeftButtonDown="pathOption1_MouseLeftButtonDown"/>

    <Path x:Name="pathOption2Glossy" Width="80" Height="9.61334" Canvas.Left="84" Canvas.Top="35" Stretch="Fill" Fill="#5AFFFFFF" Data="F1 M 0.400085,0.339256L 99.9791,0.339317L 109.442,9.9526L 10.3999,9.95248L 0.400085,0.339256 Z " MouseLeftButtonDown="pathOption2_MouseLeftButtonDown"/>

    <Path x:Name="pathOption3Glossy" Width="80" Height="9.61334" Canvas.Left="158" Canvas.Top="35" Stretch="Fill" Fill="#5AFFFFFF" Data="F1 M 0.400085,0.339256L 99.9791,0.339317L 109.442,9.9526L 10.3999,9.95248L 0.400085,0.339256 Z " MouseLeftButtonDown="pathOption3_MouseLeftButtonDown"/>

    <TextBlock x:Name="tblOption1" Cursor="Hand" Text="Option1" Canvas.Top="38" Canvas.Left="20" Foreground="White" Style="{StaticResource tblLabelStyle}" MouseLeftButtonDown="pathOption1_MouseLeftButtonDown" d:IsHidden="True" />

    <TextBlock x:Name="tblOption2" Text="Option2" Canvas.Top="38" Canvas.Left="98" Foreground="White" Style="{StaticResource tblLabelStyle}" MouseLeftButtonDown="pathOption2_MouseLeftButtonDown"/>

    <TextBlock x:Name="tblOption3" Text="Option3" Canvas.Top="38" Canvas.Left="169" Foreground="White" Style="{StaticResource tblLabelStyle}" MouseLeftButtonDown="pathOption3_MouseLeftButtonDown" />

    <Border Height="322" Width="450" Background="Transparent" BorderBrush="#E6E6E6" Canvas.Left="7" Canvas.Top="58" BorderThickness="2" CornerRadius="2">

     

    <Canvas Height="322" Width="450" Background="Transparent" Visibility="Visible" x:Name="cnvRevisedLOA">

    <basics:TabControl x:Name="TabOption1" Height="322" Width="450" Canvas.Top="100" Canvas.Left="-80" Background="Transparent" BorderThickness="0" Style="{StaticResource TabControlStyle2}" >

    <basics:TabItem x:Name="tabModficationdetails" IsSelected="True" Margin="-58,-88,58,88" Height="20" Header="MODIFICATION DETAILS" Style="{StaticResource CustomTabControl}" >

    <StackPanel Canvas.Left="-1" Width="450" Background="Transparent" >

    <Mcontrols:Expander ExpandDirection="Down" IsExpanded="True" Header="Modification Details" Margin="-6,0,10,0" Style="{StaticResource ExpanderStyle1}">

    <Canvas x:Name="cnvLoanSnapshot" Background="Transparent" Margin="-90,20,0,0" Height="136" Width="380" >

    <TextBlock Text="Account Number:" x:Name="tblAccountNumber" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="50" Canvas.Top="4"/>

    <TextBlock Text="xxxxxxx" x:Name="tblAccountNumbervalue" FontSize="11" Foreground="DarkGray" Canvas.Left="145" Canvas.Top="4" Style="{StaticResource tblLabelStyle}"/>

    <TextBlock Text=" Product:" x:Name="tblProduct" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="91" Canvas.Top="29"/>

    <TextBox Text="Loren ipsum" x:Name="tblProductvalue" FontSize="11" Foreground="DarkGray" Height="20" Width="80" Canvas.Left="141" Canvas.Top="26" Style="{StaticResource RoundCornerTextBoxStyle}" />

    <TextBlock Text=" Interest Rate:" x:Name="tblInterestRate" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="65" Canvas.Top="57"/>

    <TextBox Text="xx%" x:Name="tblInterestRatevalue" FontFamily="Trebuchet MS" Foreground="DarkGray" Canvas.Left="141" Height="20" Width="80" Canvas.Top="53" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <TextBlock Text=" Outstanding Principal:" x:Name="tblOutstandingPrincipal" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="20" Canvas.Top="85"/>

    <TextBox Text="xxxxxxxx" x:Name="tblOutstandingPrincipalvalue" FontSize="11" FontFamily="Trebuchet MS" Foreground="DarkGray" Canvas.Left="141" Canvas.Top="81" Height="20" Width="80" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <TextBlock Text=" Total Outstanding:" x:Name="tblTotalOutstanding" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="39" Canvas.Top="113"/>

    <TextBox Text="xxxxxxxx" x:Name="tblTotalOutstandingvalue" FontSize="11" FontFamily="Trebuchet MS" Foreground="DarkGray" Canvas.Left="141" Canvas.Top="109" Height="20" Width="80" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <TextBlock Text=" Tenure:" x:Name="tblTenure" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="93" Canvas.Top="141"/>

    <TextBox Text="xx" x:Name="tblTenurevalue" FontFamily="Trebuchet MS" Foreground="DarkGray" FontSize="11" Canvas.Left="141" Canvas.Top="137" Height="20" Width="80" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <TextBlock Text="Loan Type:" x:Name="tblLoanType" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="305" Canvas.Top="4"/>

    <TextBlock Text="Loren ipsum" x:Name="tblLoanTypevalue" Foreground="DarkGray" FontSize="11" Canvas.Left="370" Canvas.Top="4" Style="{StaticResource tblLabelStyle}"/>

    <TextBlock Text=" Program:" x:Name="tblProgram" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="310" Canvas.Top="29"/>

    <TextBox Text="Loren ipsum" x:Name="tblProgramvalue" FontFamily="Trebuchet MS" Foreground="DarkGray" FontSize="11" Canvas.Left="362" Canvas.Top="25" Height="20" Width="80" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <TextBlock Text="Principal Balance:" x:Name="tblPrincipalBalance" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="268" Canvas.Top="57"/>

    <TextBox Text="xxxxxxxx" x:Name="tblPrincipalBalancevalue" FontSize="11" FontFamily="Trebuchet MS" Foreground="DarkGray" Canvas.Left="362" Canvas.Top="53" Height="20" Width="80" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <TextBlock Text=" Other Payments Due:" x:Name="tblOtherPaymentsDue" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="248" Canvas.Top="85"/>

    <TextBox Text="xxxxxxxx" x:Name="tblOtherPaymentsDuevalue" FontFamily="Trebuchet MS" Foreground="DarkGray" FontSize="11" Canvas.Left="362" Canvas.Top="81" Height="20" Width="80" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <TextBlock Text=" No of Overdue Payments:" x:Name="tblNoofOverduePayments" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="226" Canvas.Top="113"/>

    <TextBox Text="xxx" x:Name="tblNoofOverduePaymentsvalue" FontFamily="Trebuchet MS" Foreground="DarkGray" FontSize="11" Canvas.Left="362" Canvas.Top="109" Height="20" Width="80" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <TextBlock Text=" Balance Tenure:" x:Name="tblBalanceTenure" Style="{StaticResource tblLabelStyle}" FontSize="11" Canvas.Left="272" Canvas.Top="141"/>

    <TextBox Text="xx" x:Name="tblBalanceTenurevalue" FontFamily="Trebuchet MS" Foreground="DarkGray" FontSize="11" Canvas.Left="362" Canvas.Top="137" Height="20" Width="80" Style="{StaticResource RoundCornerTextBoxStyle}" />

    </Canvas>

    </Mcontrols:Expander>

    <Mcontrols:Expander ExpandDirection="Down" IsExpanded="True" Header="Revised Loan Schedule" Margin="-15,20,0,0" Width="450" Style="{StaticResource ExpanderStyle1}">

    <Canvas x:Name="cnvRevisedLoanSchedule" Height="150" Background="Transparent">

    <data:DataGrid x:Name="dgRevisedLoanSchedule" AutoGenerateColumns="False" Canvas.Left="12" AlternatingRowBackground="Transparent" Canvas.Top="21" CanUserResizeColumns="False"

    VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden" IsReadOnly="True"

    Width="436" FontFamily="Trebuchet MS" FontSize="11" Foreground="Gray" BorderThickness="0" VerticalGridLinesBrush="White" ColumnHeaderStyle="{StaticResource newColumnHeaderStyle}" CellStyle="{StaticResource CellStyle}" >

    <data:DataGrid.Columns >

    <data:DataGridTextColumn Header="Int Rate" Width="50" Binding="{Binding Path=Intrestrate}" />

    <data:DataGridTextColumn Header="Due Date" Width="57" Binding="{Binding Path=DueDate}" />

    <data:DataGridTextColumn Header="Interest" Width="53" Binding="{Binding Path=Interest}" />

    <data:DataGridTextColumn Header="Installment Amt." Width="93" Binding="{Binding Path=InstallmentAmount}" />

    <data:DataGridTextColumn Header="Principal" Width="56" Binding="{Binding Path=PrincipalAmount}" />

    <data:DataGridTextColumn Header="Escrow" Width="47" Binding="{Binding Path=Escrow}" />

    <data:DataGridTextColumn Header="Prinicipal Bal." Width="72" Binding="{Binding Path=PrincipalBalance}" />

    </data:DataGrid.Columns>

    </data:DataGrid>

    <Button Height="16" Canvas.Left="425" Canvas.Top="105" Style="{StaticResource DataGridPopUpButton}" Click="Button_Click" Width="14" FontFamily="Trebuchet MS" FontSize="18" Content="+" Foreground="#FFFFFFFF"/>

    </Canvas>

    </Mcontrols:Expander>

    </StackPanel>

    </basics:TabItem>

    <basics:TabItem x:Name="tabWhatIfAnalysis" IsSelected="True" MouseLeftButtonDown="tabWhatIfAnalysis_MouseLeftButtonDown" Margin="-58,-88,58,88" Height="20" Header="WHAT-IF ANALYSIS" Style="{StaticResource CustomTabControl}" >

    <Canvas x:Name="cnvWhatisAnalysis" Background="Transparent">

    <Canvas.Resources>

    <Storyboard x:Name="sbScaleXDollarBag">

    <DoubleAnimation x:Name="dbScaleScaleXDollarBag" Storyboard.TargetName="imgDollarBag" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Duration="00:00:0.1"/>

    <DoubleAnimation x:Name="dbScaleScaleYDollarBag" Storyboard.TargetName="imgDollarBag" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Duration="00:00:0.1"/>

    <DoubleAnimation x:Name="dbTranslateScaleXDollarBag" Storyboard.TargetName="imgDollarBag" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.X)" Duration="00:00:00"/>

    </Storyboard>

    <Storyboard x:Name="sbScaleXHome">

    <!--<DoubleAnimation x:Name="dbScaleScaleXHome" Storyboard.TargetName="imgHome" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Duration="00:00:0.1"/>

    <DoubleAnimation x:Name="dbScaleScaleYHome" Storyboard.TargetName="imgHome" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Duration="00:00:0.1"/>-->

    <DoubleAnimation x:Name="dbTranslateScaleHome" Storyboard.TargetName="imgHome" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.X)" Duration="00:00:00"/>

    </Storyboard>

    </Canvas.Resources>

    <Rectangle x:Name="rectWhatIfAnalysis" Height="25" Width="420" Canvas.Top="1" Canvas.Left="12" Style="{StaticResource ExpanderRectangleStyle}" />

    <TextBlock x:Name="tblWhatIfAnalysis" Text="What-If Analysis" Canvas.Left="22" Canvas.Top="25" FontSize="11" Style="{StaticResource TextBlockGrayHeaderStyle}" />

    <TextBlock x:Name="tblAnalysisInstallmentAmount" Text="InstallmentAmount:" FontSize="11" Canvas.Top="45" Width="125" TextAlignment="Right" Style="{StaticResource tblLabelStyle}" />

    <TextBox x:Name="txtInstallmentAmount" Text="" LostFocus="txtInstallmentAmount_LostFocus" Canvas.Top="41" Canvas.Left="128" Width="70" Height="20" Style="{StaticResource RoundCornerTextBoxStyle}" />

    <TextBlock x:Name="tblAnalysisTenure" Text="Tenure:" FontSize="11" Canvas.Top="45" Canvas.Left="270" Style="{StaticResource tblLabelStyle}"/>

    <TextBox x:Name="txtAnalysisTenure" Text="" LostFocus="txtAnalysisTenure_LostFocus" Canvas.Top="41" Canvas.Left="315" Width="70" Height="20" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <TextBlock x:Name="tblAnalysisInitialInterest" Text="Initial Interest Rate:" FontSize="11" Canvas.Top="76" Width="125" TextAlignment="Right" Style="{StaticResource tblLabelStyle}"/>

    <TextBox x:Name="txtAnalysisInterestRate" Text="" Canvas.Top="72" Canvas.Left="128" Width="70" Height="20" Style="{StaticResource RoundCornerTextBoxStyle}"/>

    <Border x:Name="bdrCashOverFlow" Height="35" Width="75" Canvas.Left="12" Canvas.Top="122" BorderThickness=".6" BorderBrush=" orange" CornerRadius="2" >

    <Border.Background>

    <LinearGradientBrush StartPoint="0.500003,0.400001" EndPoint="0.500003,-1.55555">

    <LinearGradientBrush.GradientStops>

    <GradientStop Color="#FFFEE101" Offset="0.0138249"/>

    <GradientStop Color="#FFFEA000" Offset="0.576037"/>

    <GradientStop Color="#FFFF5F00" Offset="1"/>

    </LinearGradientBrush.GradientStops>

    </LinearGradientBrush>

    </Border.Background>

    <TextBlock x:Name="tblCashOverFlow" Width="60" TextWrapping="Wrap" Text="Total Cash Outflow" Margin="1,0,0,0" Style="{StaticResource tblLabelStyle}"/>

    </Border>

     

    <Canvas x:Name="cnvCashSlider" Canvas.Left="-15">

    <Image x:Name="imgDollarBag" Source="Images/DollarBag.png" Width="60" Height="100" Canvas.Left="128" Canvas.Top="50" RenderTransformOrigin="0.5,0.5" >

    <Image.RenderTransform>

    <TransformGroup>

     

    <ScaleTransform ScaleX="0" ScaleY="0"/>

    <TranslateTransform x:Name="DollarBagTranslateTransform"/>

    </TransformGroup>

     

    </Image.RenderTransform>

    </Image>

    <ProgressBar x:Name="pbCashOverFlow" Canvas.Top="-3" Foreground="Yellow" Canvas.Left="68" IsIndeterminate="False" Minimum="0" Maximum="2500" BorderThickness="2.5" BorderBrush="Green" Width="225" Height="10" Style="{StaticResource ProgressBarStyle1}" d:LayoutOverrides="Height" VerticalAlignment="Top" Margin="92,136,83,0"/>

    <Slider x:Name="slrCashOverFlow" Width="225" Minimum="0" Maximum="2500" Canvas.Top="126.5" Canvas.Left="161" ValueChanged="slide_ValueChanged" Style="{StaticResource SliderStyle1}" />

    <Line X1="-3" Y1="0" X2="-3" Y2="5" Stroke="Black" Canvas.Left="170" Canvas.Top="142" StrokeThickness=".4" />

    <TextBlock x:Name="tblZeroCashOverFlow" Text="0" Canvas.Top="150" Canvas.Left="165" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="-2" Y1="0" X2="-2" Y2="5" Stroke="Black" Canvas.Left="190" Canvas.Top="142" StrokeThickness=".4" />

    <Line X1="0" Y1="0" X2="0" Y2="5" Stroke="Black" Canvas.Left="210" Canvas.Top="142" StrokeThickness=".4" />

    <TextBlock x:Name="tbl500CashOverFlow" Text="500" Canvas.Top="150" Canvas.Left="203" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="1" Y1="0" X2="1" Y2="5" Stroke="Black" Canvas.Left="230" Canvas.Top="142" StrokeThickness=".4" />

    <Line X1="3" Y1="0" X2="3" Y2="5" Stroke="Black" Canvas.Left="250" Canvas.Top="142" StrokeThickness=".4" />

    <TextBlock x:Name="tbl1000CashOverFlow" Text="1000" Canvas.Top="150" Canvas.Left="242" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="4" Y1="0" X2="4" Y2="5" Stroke="Black" Canvas.Left="270" Canvas.Top="142" StrokeThickness=".4" />

    <Line X1="5" Y1="0" X2="5" Y2="5" Stroke="Black" Canvas.Left="290" Canvas.Top="142" StrokeThickness=".4" />

    <TextBlock x:Name="tbl1500CashOverFlow" Text="1500" Canvas.Top="150" Canvas.Left="285" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="7" Y1="0" X2="7" Y2="5" Stroke="Black" Canvas.Left="310" Canvas.Top="142" StrokeThickness=".4" />

    <Line X1="8" Y1="0" X2="8" Y2="5" Stroke="Black" Canvas.Left="330" Canvas.Top="142" StrokeThickness=".4" />

    <TextBlock x:Name="tbl2000CashOverFlow" Text="2000" Canvas.Top="150" Canvas.Left="328" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="10" Y1="0" X2="10" Y2="5" Stroke="Black" Canvas.Left="350" Canvas.Top="142" StrokeThickness=".4" />

    <Line X1="11" Y1="0" X2="11" Y2="5" Stroke="Black" Canvas.Left="370" Canvas.Top="142" StrokeThickness=".4" />

    <TextBlock x:Name="tbl2500CashOverFlow" Text="2500" Canvas.Top="150" Canvas.Left="372" Style="{StaticResource SliderLabelStyle}"/>

    <TextBlock x:Name="tblForwardScale_Scale" Text="Amount" Foreground="#909090" Canvas.Top="165" Canvas.Left="245" Style="{StaticResource tblLabelStyle}" />

    </Canvas>

    <Image x:Name="imgCashBank" Canvas.Left="381" Canvas.Top="113.545" Source="Images/Bank.png"/>

    <Image x:Name="imgCashBorrower" Canvas.Left="103" Canvas.Top="120.545" Source="Images/Borrower.png"/>

    <TextBlock x:Name="tblCashBorrower" Text="BORROWER" Canvas.Left="93" FontFamily="TREBUCHET MS" FontSize="9" Canvas.Top="150" Foreground="#FF00385B"/>

    <TextBlock x:Name="tblCashBank" Text="BANK" Canvas.Left="391" FontFamily="TREBUCHET MS" FontSize="9" Canvas.Top="150" Foreground="#FF00385B"/>

    <Image x:Name="imgTimeBank" Canvas.Left="381" Canvas.Top="201.545" Source="Images/Bank.png"/>

    <Image x:Name="imgTimeBorrower" Canvas.Left="103" Canvas.Top="206.545" Source="Images/Borrower.png"/>

    <TextBlock x:Name="tblTimeBorrower" Text="BORROWER" Canvas.Left="93" FontFamily="TREBUCHET MS" FontSize="9" Canvas.Top="236" Foreground="#FF00385B"/>

    <TextBlock x:Name="tblTimeBank" Text="BANK" Canvas.Left="391" FontFamily="TREBUCHET MS" FontSize="9" Canvas.Top="237" Foreground="#FF00385B"/>

    <Border x:Name="bdrTimetoOwn" Height="35" Width="75" Canvas.Left="12" Canvas.Top="207" BorderThickness=".6" BorderBrush=" orange" CornerRadius="2" >

    <Border.Background>

    <LinearGradientBrush StartPoint="0.500003,0.400001" EndPoint="0.500003,-1.55555">

    <LinearGradientBrush.GradientStops>

    <GradientStop Color="#FFFEE101" Offset="0.0138249"/>

    <GradientStop Color="#FFFEA000" Offset="0.576037"/>

    <GradientStop Color="#FFFF5F00" Offset="1"/>

    </LinearGradientBrush.GradientStops>

    </LinearGradientBrush>

    </Border.Background>

    <TextBlock x:Name="tblTimetoOwn" TextWrapping="Wrap" Text="Additional Time to Own" Style="{StaticResource tblLabelStyle}"/>

    </Border>

    <Canvas x:Name="cnvTimeSlider" Canvas.Left="-18">

    <Image x:Name="imgHome" Source="Images/home.png" Height="30" Canvas.Left="368" Canvas.Top="180" RenderTransformOrigin="0.5,0.5" >

    <Image.RenderTransform>

    <TransformGroup>

    <ScaleTransform ScaleX="1" ScaleY="1"/>

    <TranslateTransform x:Name="HomeTranslateTransform"/>

    </TransformGroup>

    </Image.RenderTransform>

    </Image>

    <ProgressBar x:Name="pbTime" Foreground="Yellow" Canvas.Top="94" Canvas.Left="296" IsIndeterminate="False" Minimum="0" Maximum="20" BorderThickness="2.5" BorderBrush="Green" Width="225" Height="10" Style="{StaticResource ProgressBarStyle1}" d:LayoutOverrides="Height" VerticalAlignment="Top" Margin="92,136,83,0">

    <ProgressBar.RenderTransform>

    <TransformGroup>

    <ScaleTransform/>

    <SkewTransform/>

    <RotateTransform Angle="180"/>

    <TranslateTransform/>

    </TransformGroup>

    </ProgressBar.RenderTransform>

    </ProgressBar>

    <Slider x:Name="slrTime" ToolTipService.ToolTip="Slider" Width="225" Minimum="0" Maximum="20" Canvas.Top="212.5" Canvas.Left="388.5" ValueChanged="slrTime_ValueChanged" Style="{StaticResource SliderStyle1}" >

    <Slider.RenderTransform>

    <TransformGroup>

    <ScaleTransform ScaleX="-1"/>

    <SkewTransform/>

    <RotateTransform/>

    <TranslateTransform />

    </TransformGroup>

    </Slider.RenderTransform>

    </Slider>

    <Line X1="-2" Y1="0" X2="-2" Y2="5" Stroke="Black" Canvas.Left="170" Canvas.Top="229" StrokeThickness=".4" />

    <TextBlock x:Name="tblZeroTimetoOwn" Text="0" Canvas.Top="237" Canvas.Left="167" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="-1" Y1="0" X2="-1" Y2="5" Stroke="Black" Canvas.Left="190" Canvas.Top="229" StrokeThickness=".4" />

    <Line X1="1" Y1="0" X2="1" Y2="5" Stroke="Black" Canvas.Left="210" Canvas.Top="229" StrokeThickness=".4" />

    <TextBlock x:Name="tbl4TimetoOwn" Text="4" Canvas.Top="237" Canvas.Left="208" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="2" Y1="0" X2="2" Y2="5" Stroke="Black" Canvas.Left="230" Canvas.Top="229" StrokeThickness=".4" />

    <Line X1="4" Y1="0" X2="4" Y2="5" Stroke="Black" Canvas.Left="250" Canvas.Top="229" StrokeThickness=".4" />

    <TextBlock x:Name="tbl8TimetoOwn" Text="8" Canvas.Top="237" Canvas.Left="252" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="5" Y1="0" X2="5" Y2="5" Stroke="Black" Canvas.Left="270" Canvas.Top="229" StrokeThickness=".4" />

    <Line X1="6" Y1="0" X2="6" Y2="5" Stroke="Black" Canvas.Left="290" Canvas.Top="229" StrokeThickness=".4" />

    <TextBlock x:Name="tbl12TimetoOwn" Text="12" Canvas.Top="237" Canvas.Left="292" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="8" Y1="0" X2="8" Y2="5" Stroke="Black" Canvas.Left="310" Canvas.Top="229" StrokeThickness=".4" />

    <Line X1="9" Y1="0" X2="9" Y2="5" Stroke="Black" Canvas.Left="330" Canvas.Top="229" StrokeThickness=".4" />

    <TextBlock x:Name="tbl16TimetoOwn" Text="16" Canvas.Top="237" Canvas.Left="335" Style="{StaticResource SliderLabelStyle}"/>

    <Line X1="11" Y1="0" X2="11" Y2="5" Stroke="Black" Canvas.Left="350" Canvas.Top="229" StrokeThickness=".4" />

    <Line X1="12" Y1="0" X2="12" Y2="5" Stroke="Black" Canvas.Left="370" Canvas.Top="229" StrokeThickness=".4" />

    <TextBlock x:Name="tbl20TimetoOwn" Text="20" Canvas.Top="237" Canvas.Left="377" Style="{StaticResource SliderLabelStyle}"/>

    <TextBlock x:Name="tblForwardYearScale" Text="Number of Years" Foreground="#909090" Canvas.Top="252" Canvas.Left="224" Style="{StaticResource tblLabelStyle}" />

    </Canvas>

    </Canvas>

    </basics:TabItem>

    <basics:TabItem x:Name="tabPotentialBenefits" Margin="-58,-88,58,88" Height="20" Header="POTENTIAL BENEFITS" Style="{StaticResource CustomTabControl}" >

    <Canvas x:Name="tabPotentialBnefit" Background="Transparent">

    <Rectangle x:Name="rectPotentialBenefits" Height="25" Width="420" Canvas.Top="9" Canvas.Left="12" Style="{StaticResource ExpanderRectangleStyle}" />

    <TextBlock x:Name="tblPotentialBenefits" Text="Potential Benefits" Canvas.Left="22" Canvas.Top="32" FontSize="11" Style="{StaticResource TextBlockGrayHeaderStyle}" />

    <Border Height="40" Width="420" Canvas.Top="40" Canvas.Left="12" >

    <Border.BorderBrush>

    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

    <GradientStop Color="#FF000000"/>

    <GradientStop Color="#FFFFF6F6" Offset="0"/>

    </LinearGradientBrush>

    </Border.BorderBrush>

    <Border.Background>

    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

    <GradientStop Color="#FFC8C8C8" Offset="0"/>

    <GradientStop Color="#FFF5F5F5" Offset="0.004"/>

    <GradientStop Color="#FFECEEF0" Offset="1"/>

    </LinearGradientBrush>

    </Border.Background>

    <TextBlock x:Name="tblPotentialBenefitTopText" Text="This analysis for a modification plan of 38% of net household income at an interest rate of 3%" TextAlignment="Center" TextWrapping="Wrap" Style="{StaticResource tblLabelStyle}" />

    </Border>

    <Path x:Name="Dividing_LinePotentialBenefitTop" Width="431.5" Height="0.500061" Canvas.Left="12" Canvas.Top="40" Stretch="Fill" Data="F1 M 0.249985,0.500031L 431.25,0.499969" StrokeThickness="0.5" StrokeLineJoin="Round">

    <Path.Stroke>

    <LinearGradientBrush StartPoint="-3.53622e-008,0.499939" EndPoint="1,0.499939">

    <LinearGradientBrush.GradientStops>

    <GradientStop Color="#FFF8FCFF" Offset="0"/>

    <GradientStop Color="#FF83829B" Offset="0.086758"/>

    <GradientStop Color="#FF0E0938" Offset="0.497717"/>

    <GradientStop Color="#FFFFFFFF" Offset="1"/>

    </LinearGradientBrush.GradientStops>

    </LinearGradientBrush>

    </Path.Stroke>

    </Path>

    <Path x:Name="Dividing_LinePotentialBenefitBottom" Width="431.5" Height="0.500061" Canvas.Left="12" Canvas.Top="80" Stretch="Fill" Data="F1 M 0.249985,0.500031L 431.25,0.499969" StrokeThickness="0.5" StrokeLineJoin="Round">

    <Path.Stroke>

    <LinearGradientBrush StartPoint="-3.53622e-008,0.499939" EndPoint="1,0.499939">

    <LinearGradientBrush.GradientStops>

    <GradientStop Color="#FFF8FCFF" Offset="0"/>

    <GradientStop Color="#FF83829B" Offset="0.086758"/>

    <GradientStop Color="#FF0E0938" Offset="0.497717"/>

    <GradientStop Color="#FFFFFFFF" Offset="1"/>

    </LinearGradientBrush.GradientStops>

    </LinearGradientBrush>

    </Path.Stroke>

    </Path>

    <Rectangle x:Name="rectComment1" Height="4" Width="4" Fill="Orange" Canvas.Left="15" Canvas.Top="89" />

    <TextBlock x:Name="tblComment1" Canvas.Left="22" Canvas.Top="85" TextWrapping="Wrap" Width="400" FontWeight="Normal" Style="{StaticResource tblLabelStyle}" />

    <Rectangle x:Name="rectComment2" Height="4" Width="4" Fill="Orange" Canvas.Left="15" Canvas.Top="119" />

    <TextBlock x:Name="tblComment2" Canvas.Left="22" Canvas.Top="115" TextWrapping="Wrap" Width="400" FontWeight="Normal" Style="{StaticResource tblLabelStyle}" />

    <Rectangle x:Name="rectComment3" Height="4" Width="4" Fill="Orange" Canvas.Left="15" Canvas.Top="149" />

    <TextBlock x:Name="tblComment3" Canvas.Left="22" Canvas.Top="145" TextWrapping="Wrap" Width="400" FontWeight="Normal" Style="{StaticResource tblLabelStyle}" />

    <Rectangle x:Name="rectComment4" Height="4" Width="4" Fill="Orange" Canvas.Left="15" Canvas.Top="179" />

    <TextBlock x:Name="tblComment4" Canvas.Left="22" Canvas.Top="175" TextWrapping="Wrap" Width="400" FontWeight="Normal" Style="{StaticResource tblLabelStyle}" />

    <Rectangle x:Name="rectComment5" Height="4" Width="4" Fill="Orange" Canvas.Left="15" Canvas.Top="199" />

    <TextBlock x:Name="tblComment5" Canvas.Left="22" Canvas.Top="195" TextWrapping="Wrap" Width="400" FontWeight="Normal" Style="{StaticResource tblLabelStyle}" />

    <Rectangle x:Name="rectComment6" Height="4" Width="4" Fill="Orange" Canvas.Left="15" Canvas.Top="219" />

    <TextBlock x:Name="tblComment6" Canvas.Left="22" Canvas.Top="215" TextWrapping="Wrap" Width="400" FontWeight="Normal" Style="{StaticResource tblLabelStyle}" />

    <Rectangle x:Name="rectComment7" Height="4" Width="4" Fill="Orange" Canvas.Left="15" Canvas.Top="249" />

    <TextBlock x:Name="tblComment7" Canvas.Left="22" Canvas.Top="245" TextWrapping="Wrap" Width="400" FontWeight="Normal" Style="{StaticResource tblLabelStyle}" />

    <Path x:Name="Dividing_LineTop" Width="431.5" Height="0.500061" Canvas.Left="12" Canvas.Top="272" Stretch="Fill" Data="F1 M 0.249985,0.500031L 431.25,0.499969" StrokeThickness="0.5" StrokeLineJoin="Round">

    <Path.Stroke>

    <LinearGradientBrush StartPoint="-3.53622e-008,0.499939" EndPoint="1,0.499939">

    <LinearGradientBrush.GradientStops>

    <GradientStop Color="#FFF8FCFF" Offset="0"/>

    <GradientStop Color="#FF83829B" Offset="0.086758"/>

    <GradientStop Color="#FF0E0938" Offset="0.497717"/>

    <GradientStop Color="#FFFFFFFF" Offset="1"/>

    </LinearGradientBrush.GradientStops>

    </LinearGradientBrush>

    </Path.Stroke>

    </Path>

    <Path x:Name="Dividing_LineBottom" Width="431.5" Height="0.500061" Canvas.Left="12" Canvas.Top="313" Stretch="Fill" Data="F1 M 0.249985,0.500031L 431.25,0.499969" StrokeThickness="0.5" StrokeLineJoin="Round">

    <Path.Stroke>

    <LinearGradientBrush StartPoint="-3.53622e-008,0.499939" EndPoint="1,0.499939">

    <LinearGradientBrush.GradientStops>

    <GradientStop Color="#FFF8FCFF" Offset="0"/>

    <GradientStop Color="#FF83829B" Offset="0.086758"/>

    <GradientStop Color="#FF0E0938" Offset="0.497717"/>

    <GradientStop Color="#FFFFFFFF" Offset="1"/>

    </LinearGradientBrush.GradientStops>

    </LinearGradientBrush>

    </Path.Stroke>

    </Path>

    <Border Height="40" Width="420" Canvas.Top="273" Canvas.Left="12" >

    <Border.BorderBrush>

    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

    <GradientStop Color="#FF000000"/>

    <GradientStop Color="#FFFFF6F6" Offset="0"/>

    </LinearGradientBrush>

    </Border.BorderBrush>

    <Border.Background>

    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

    <GradientStop Color="#FFC8C8C8" Offset="0"/>

    <GradientStop Color="#FFF5F5F5" Offset="0.004"/>

    <GradientStop Color="#FFECEEF0" Offset="1"/>

    </LinearGradientBrush>

    </Border.Background>

    <TextBlock x:Name="tblPotentialBenefitBottomText" Width="380" TextAlignment="Center" TextWrapping="Wrap" Style="{StaticResource tblLabelStyle}" />

    </Border>

    </Canvas>

    </basics:TabItem>

    </basics:TabControl>

    </Canvas>

    </Border>

    </Canvas>

    </Border>

     

    <Button x:Name="btnSave" Content="SAVE" Style="{StaticResource OrangeGradientButtonStyle}" Canvas.Top="413" Canvas.Left="190" Width="50"></Button>

    <Button x:Name="btnSaveNSelect" Content="SAVE &amp; SELECT" Style="{StaticResource OrangeGradientButtonStyle}" Canvas.Top="413" Canvas.Left="270" Width="80"></Button>

    <Button x:Name="btnCompareOptions" Content="COMPARE MY OPTIONS" Width="100" Style="{StaticResource OrangeGradientButtonStyle}" Canvas.Top="25" Canvas.Left="340"></Button>

    <Canvas x:Name="cnvGrayLayer" Height="620" Width="1020" Opacity=".7" Canvas.Left="-210" Canvas.Top="-135" Visibility="Collapsed" Background="Black" ></Canvas>

    <Canvas x:Name="cnvPopLayer" Visibility="Collapsed" Canvas.Left="-160" Canvas.Top="-130">

    <Border Height="410" Width="680" BorderBrush="#E6E6E6" Canvas.Left="83" Canvas.Top="83" x:Name="bdrMainRevised" BorderThickness="2" CornerRadius="11">

    <Border.Background>

    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

    <GradientStop Color="#FFD7D7D7" Offset="1"/>

    <GradientStop Color="#FFFFFFFF" Offset="0.121"/>

    <GradientStop Color="#FFD7D7D7" Offset="1.996"/>

    <GradientStop Color="#FFF6F3F3" Offset="0.996"/>

    </LinearGradientBrush>

    </Border.Background>

    <Canvas x:Name="cnvRevisedLoanSchedulePopUp" >

    <Path x:Name="pathRevisedHeader" Width="680" Height="38" Canvas.Left="-2" Canvas.Top="-2" Stretch="Fill" StrokeThickness="1" StrokeLineJoin="Round" Stroke="#C0000000" Data="F1 M 10,0C 4.47719,0 3.43323e-005,4.47711 3.43323e-005,10L 0,48.9999L 895.999,48.9999L 895.999,10C 895.999,4.47711 891.522,0 885.999,0L 10,0 Z ">

    <Path.Fill>

    <LinearGradientBrush StartPoint="0.448091,1.30625" EndPoint="0.448091,-0.652841">

    <LinearGradientBrush.GradientStops>

    <GradientStop Color="#C049494A" Offset="0"/>

    <GradientStop Color="#C0838485" Offset="0.497717"/>

    <GradientStop Color="#C0BDBFC0" Offset="1"/>

    </LinearGradientBrush.GradientStops>

    </LinearGradientBrush>

    </Path.Fill>

    </Path>

    <TextBlock x:Name="tblRevisedLoanSchedulePOPup" Text="Revised Loan Schedule" Style="{StaticResource TextBlockHeaderStyle}" Canvas.Left="22" Canvas.Top="25" Foreground="WHITE" ></TextBlock>

    <Image Source="Images/CloseButton.png" MouseLeftButtonDown="Image_MouseLeftButtonDown" Canvas.Left="633" Canvas.Top="-3"></Image>

    <data:DataGrid x:Name="dgdRevisedLoanSchedulePopUp" Canvas.Top="44" AutoGenerateColumns="False" Canvas.Left="50" CanUserResizeColumns="False"

    VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" Background="Transparent" IsReadOnly="True"

    Width="580" FontFamily="Trebuchet MS" FontSize="11" Foreground="Gray" Height="320" GridLinesVisibility="Vertical" BorderThickness="0" VerticalGridLinesBrush="White" ColumnHeaderStyle="{StaticResource newColumnHeaderStyle}" CellStyle="{StaticResource CellStyle}" >

    <data:DataGrid.Columns >

    <data:DataGridTextColumn Header="Int Rate" Width="50" Binding="{Binding Path=Intrestrate}" />

    <data:DataGridTextColumn Header="Due Date" Width="57" Binding="{Binding Path=DueDate}" />

    <data:DataGridTextColumn Header="Interest" Width="53" Binding="{Binding Path=Interest}" />

    <data:DataGridTextColumn Header="Installment Amt." Width="93" Binding="{Binding Path=InstallmentAmount}" />

    <data:DataGridTextColumn Header="Principal" Width="56" Binding="{Binding Path=PrincipalAmount}" />

    <data:DataGridTextColumn Header="Escrow" Width="47" Binding="{Binding Path=Escrow}" />

    <data:DataGridTextColumn Header="Prinicipal Bal." Width="72" Binding="{Binding Path=PrincipalBalance}" />

    </data:DataGrid.Columns>

    </data:DataGrid>

    </Canvas>

     

     

    </Border>

    </Canvas>

    </Canvas>

    Tuesday, July 14, 2009 4:56 AM
  • Hi aswin

    Can you simplify your code and make it reproduce your problem, and then post them here?

    Which will be helpful to reproduce your problem for us and find the cause of the problem.

    Monday, July 20, 2009 11:23 PM
  • I get the same error by creating a VisualStateGroup from scratch and adding a new State to animate a control and when I do this bu C# code

    VisualStateManager.GoToState(this, "OpenForm", true); it crashes with the error.

    In Blend 4 it works like a charm.  but running the application in VS2010 it stops on the VisualStateManager.GoToState with the error mention in this thread.  I don't know what's going on !

     

    Tuesday, May 11, 2010 11:17 AM
  • Do you have the project that we can repro the issue?  Can you show us the XAML and C# for the storyboard and the storyboard call?

    Tuesday, May 11, 2010 11:35 AM
  • Here's the xaml but for the C# code it's not about StoryBoard but about calling VisualStateManager.GotoState(this, "Control", true) simply.  Be aware that there are things in there that you will not be able to use as I have a few Third Party controls

     

    1    <UserControl
    2        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    3        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    4        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    5    	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    6    	xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
    7    	xmlns:PolyrolControls="clr-namespace:PolyrolControls;assembly=PolyrolControls"
    8    	xmlns:System="clr-namespace:System;assembly=mscorlib"
    9    	xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    10   	xmlns:Telerik_Windows_Controls_GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
    11   	xmlns:System_Collections_Generic="clr-namespace:System.Collections.Generic;assembly=mscorlib"
    12   	xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
    13   	xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    14   	xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    15   	xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    16   	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
    17       mc:Ignorable="d"
    18   	x:Class="Polyrol.MainPage" MinWidth="817" MinHeight="547" d:DesignWidth="1396" d:DesignHeight="862" Margin="0,3,0,-3">
    19   	<UserControl.Resources>
    20   		<ControlTemplate x:Key="ValidationToolTipTemplate">
    21   			<Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
    22   				<VisualStateManager.VisualStateGroups>
    23   					<VisualStateGroup x:Name="OpenStates">
    24   						<VisualStateGroup.Transitions>
    25   							<VisualTransition GeneratedDuration="0"/>
    26   							<VisualTransition GeneratedDuration="0:0:0.2" To="Open">
    27   								<Storyboard>
    28   									<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
    29   										<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
    30   									</DoubleAnimationUsingKeyFrames>
    31   								</Storyboard>
    32   							</VisualTransition>
    33   						</VisualStateGroup.Transitions>
    34   						<VisualState x:Name="Closed">
    35   							<Storyboard>
    36   								<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
    37   									<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
    38   								</DoubleAnimationUsingKeyFrames>
    39   							</Storyboard>
    40   						</VisualState>
    41   						<VisualState x:Name="Open">
    42   							<Storyboard>
    43   								<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
    44   									<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    45   								</DoubleAnimationUsingKeyFrames>
    46   							</Storyboard>
    47   						</VisualState>
    48   					</VisualStateGroup>
    49   				</VisualStateManager.VisualStateGroups>
    50   				<Grid.RenderTransform>
    51   					<TranslateTransform x:Name="xform" X="-25"/>
    52   				</Grid.RenderTransform>
    53   				<Border Margin="4,4,-4,-4" Background="#052A2E31" CornerRadius="5"/>
    54   				<Border Margin="3,3,-3,-3" Background="#152A2E31" CornerRadius="4"/>
    55   				<Border Margin="2,2,-2,-2" Background="#252A2E31" CornerRadius="3"/>
    56   				<Border Margin="1,1,-1,-1" Background="#352A2E31" CornerRadius="2"/>
    57   				<Border Background="#FFDC000C" CornerRadius="2"/>
    58   				<Border CornerRadius="2">
    59   					<TextBlock Margin="8,4,8,4" MaxWidth="250" UseLayoutRounding="false" Foreground="White" Text="{Binding (Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap"/>
    60   				</Border>
    61   			</Grid>
    62   		</ControlTemplate>
    63   		<Style x:Key="PolyrolButtonStyle" TargetType="Button">
    64   			<Setter Property="Background" Value="#FF1F3B53"/>
    65   			<Setter Property="Foreground" Value="#FF000000"/>
    66   			<Setter Property="Padding" Value="3"/>
    67   			<Setter Property="BorderThickness" Value="1"/>
    68   			<Setter Property="BorderBrush">
    69   				<Setter.Value>
    70   					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    71   						<GradientStop Color="#FFA3AEB9" Offset="0"/>
    72   						<GradientStop Color="#FF8399A9" Offset="0.375"/>
    73   						<GradientStop Color="#FF718597" Offset="0.375"/>
    74   						<GradientStop Color="#FF617584" Offset="1"/>
    75   					</LinearGradientBrush>
    76   				</Setter.Value>
    77   			</Setter>
    78   			<Setter Property="Template">
    79   				<Setter.Value>
    80   					<ControlTemplate TargetType="Button">
    81   						<Grid>
    82   							<VisualStateManager.VisualStateGroups>
    83   								<VisualStateGroup x:Name="CommonStates">
    84   									<VisualState x:Name="Normal"/>
    85   									<VisualState x:Name="MouseOver">
    86   										<Storyboard>
    87   											<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
    88   												<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    89   											</DoubleAnimationUsingKeyFrames>
    90   											<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
    91   												<SplineColorKeyFrame KeyTime="0" Value="#F2262626"/>
    92   											</ColorAnimationUsingKeyFrames>
    93   											<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
    94   												<SplineColorKeyFrame KeyTime="0" Value="#CC000000"/>
    95   											</ColorAnimationUsingKeyFrames>
    96   											<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
    97   												<SplineColorKeyFrame KeyTime="0" Value="#7F3D3D3D"/>
    98   											</ColorAnimationUsingKeyFrames>
    99   										</Storyboard>
    100  									</VisualState>
    101  									<VisualState x:Name="Pressed">
    102  										<Storyboard>
    103  											<ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
    104  												<SplineColorKeyFrame KeyTime="0" Value="#FF6DBDD1"/>
    105  											</ColorAnimationUsingKeyFrames>
    106  											<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
    107  												<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    108  											</DoubleAnimationUsingKeyFrames>
    109  											<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
    110  												<SplineColorKeyFrame KeyTime="0" Value="#7F000000"/>
    111  											</ColorAnimationUsingKeyFrames>
    112  											<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
    113  												<SplineColorKeyFrame KeyTime="0" Value="Black"/>
    114  											</ColorAnimationUsingKeyFrames>
    115  											<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
    116  												<SplineColorKeyFrame KeyTime="0" Value="#FF010101"/>
    117  											</ColorAnimationUsingKeyFrames>
    118  											<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
    119  												<SplineColorKeyFrame KeyTime="0" Value="#3F000000"/>
    120  											</ColorAnimationUsingKeyFrames>
    121  											<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
    122  												<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.165"/>
    123  											</DoubleAnimationUsingKeyFrames>
    124  										</Storyboard>
    125  									</VisualState>
    126  									<VisualState x:Name="Disabled">
    127  										<Storyboard>
    128  											<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
    129  												<SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
    130  											</DoubleAnimationUsingKeyFrames>
    131  											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
    132  												<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFD61313"/>
    133  											</ColorAnimationUsingKeyFrames>
    134  											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
    135  												<EasingColorKeyFrame KeyTime="00:00:00" Value="#F9BD1919"/>
    136  											</ColorAnimationUsingKeyFrames>
    137  											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
    138  												<EasingColorKeyFrame KeyTime="00:00:00" Value="#E5760D0D"/>
    139  											</ColorAnimationUsingKeyFrames>
    140  											<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
    141  												<EasingColorKeyFrame KeyTime="00:00:00" Value="#C66E0505"/>
    142  											</ColorAnimationUsingKeyFrames>
    143  											<PointAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)">
    144  												<EasingPointKeyFrame KeyTime="00:00:00" Value="0.699,0.051"/>
    145  											</PointAnimationUsingKeyFrames>
    146  											<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
    147  												<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.17"/>
    148  											</DoubleAnimationUsingKeyFrames>
    149  											<PointAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)">
    150  												<EasingPointKeyFrame KeyTime="00:00:00" Value="0.699,1"/>
    151  											</PointAnimationUsingKeyFrames>
    152  										</Storyboard>
    153  									</VisualState>
    154  								</VisualStateGroup>
    155  								<VisualStateGroup x:Name="FocusStates">
    156  									<VisualState x:Name="Focused">
    157  										<Storyboard>
    158  											<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
    159  												<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    160  											</DoubleAnimationUsingKeyFrames>
    161  										</Storyboard>
    162  									</VisualState>
    163  									<VisualState x:Name="Unfocused"/>
    164  								</VisualStateGroup>
    165  							</VisualStateManager.VisualStateGroups>
    166  							<Border x:Name="Background" Background="#FF4F4F4F" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
    167  								<Grid Margin="1" Background="{TemplateBinding Background}">
    168  									<Border x:Name="BackgroundAnimation" Opacity="0" Background="#FF448DCA"/>
    169  									<Rectangle x:Name="BackgroundGradient">
    170  										<Rectangle.Fill>
    171  											<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
    172  												<GradientStop Color="#FF6A6868" Offset="0"/>
    173  												<GradientStop Color="#F9989898" Offset="0.375"/>
    174  												<GradientStop Color="#E5AFAFAF" Offset="0.625"/>
    175  												<GradientStop Color="#C6474747" Offset="1"/>
    176  											</LinearGradientBrush>
    177  										</Rectangle.Fill>
    178  									</Rectangle>
    179  								</Grid>
    180  							</Border>
    181  							<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
    182  							<Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" RadiusX="3" RadiusY="3" IsHitTestVisible="false" Opacity="0"/>
    183  							<Rectangle x:Name="FocusVisualElement" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="2" RadiusY="2" Margin="1" IsHitTestVisible="false" Opacity="0"/>
    184  						</Grid>
    185  					</ControlTemplate>
    186  				</Setter.Value>
    187  			</Setter>
    188  		</Style>
    189  		<SolidColorBrush x:Key="MenuColor" Color="#FF1282E4"/>
    190  	</UserControl.Resources>
    191    <Grid x:Name="LayoutRoot">
    192    	<VisualStateManager.CustomVisualStateManager>
    193    		<ei:ExtendedVisualStateManager/>
    194    	</VisualStateManager.CustomVisualStateManager>
    195    	<VisualStateManager.VisualStateGroups>
    196    		<VisualStateGroup x:Name="PolyrolStateGroup" ei:ExtendedVisualStateManager.UseFluidLayout="True">
    197    			<VisualStateGroup.Transitions>
    198    				<VisualTransition GeneratedDuration="0:0:0.5"/>
    199    				<VisualTransition GeneratedDuration="0:0:0.5" To="OpenChangeMachine"/>
    200    				<VisualTransition From="OpenChangeMachine" GeneratedDuration="0:0:0.5"/>
    201    				<VisualTransition GeneratedDuration="0:0:0.5" To="OpenNewProduction"/>
    202    				<VisualTransition From="OpenNewProduction" GeneratedDuration="0:0:0.5"/>
    203    				<VisualTransition GeneratedDuration="0:0:0.5" To="HideChangeMachine"/>
    204    				<VisualTransition From="HideChangeMachine" GeneratedDuration="0:0:0.5"/>
    205    				<VisualTransition GeneratedDuration="0:0:0.5" To="HideNewProduction"/>
    206    				<VisualTransition From="HideNewProduction" GeneratedDuration="0:0:0.5"/>
    207    				<VisualTransition GeneratedDuration="0:0:0.5" To="OpenStopProduction"/>
    208    				<VisualTransition From="OpenStopProduction" GeneratedDuration="0:0:0.5"/>
    209    				<VisualTransition GeneratedDuration="0:0:0.5" To="HideStopProduction"/>
    210    				<VisualTransition From="HideStopProduction" GeneratedDuration="0:0:0.5"/>
    211    				<VisualTransition GeneratedDuration="0:0:0.5" To="OpenChangeComponents"/>
    212    				<VisualTransition From="OpenChangeComponents" GeneratedDuration="0:0:0.5"/>
    213    				<VisualTransition GeneratedDuration="0:0:0.5" To="HideChangeComponents"/>
    214    				<VisualTransition From="HideChangeComponents" GeneratedDuration="0:0:0.5"/>
    215    				<VisualTransition GeneratedDuration="0:0:0.5" To="ShowPunch"/>
    216    				<VisualTransition From="ShowPunch" GeneratedDuration="0:0:0.5"/>
    217    			</VisualStateGroup.Transitions>
    218    			<VisualState x:Name="OpenChangeMachine">
    219    				<Storyboard>
    220    					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderChangeMachine" d:IsOptimized="True"/>
    221    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderChangeMachine">
    222    						<DiscreteObjectKeyFrame KeyTime="0">
    223    							<DiscreteObjectKeyFrame.Value>
    224    								<Visibility>Visible</Visibility>
    225    							</DiscreteObjectKeyFrame.Value>
    226    						</DiscreteObjectKeyFrame>
    227    					</ObjectAnimationUsingKeyFrames>
    228    				</Storyboard>
    229    			</VisualState>
    230    			<VisualState x:Name="HideChangeMachine"/>
    231    			<VisualState x:Name="OpenNewProduction">
    232    				<Storyboard>
    233    					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderNewProduction" d:IsOptimized="True"/>
    234    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderNewProduction">
    235    						<DiscreteObjectKeyFrame KeyTime="0">
    236    							<DiscreteObjectKeyFrame.Value>
    237    								<Visibility>Visible</Visibility>
    238    							</DiscreteObjectKeyFrame.Value>
    239    						</DiscreteObjectKeyFrame>
    240    					</ObjectAnimationUsingKeyFrames>
    241    				</Storyboard>
    242    			</VisualState>
    243    			<VisualState x:Name="HideNewProduction"/>
    244    			<VisualState x:Name="OpenStopProduction">
    245    				<Storyboard>
    246    					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderStopProduction" d:IsOptimized="True"/>
    247    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderStopProduction">
    248    						<DiscreteObjectKeyFrame KeyTime="0">
    249    							<DiscreteObjectKeyFrame.Value>
    250    								<Visibility>Visible</Visibility>
    251    							</DiscreteObjectKeyFrame.Value>
    252    						</DiscreteObjectKeyFrame>
    253    					</ObjectAnimationUsingKeyFrames>
    254    				</Storyboard>
    255    			</VisualState>
    256    			<VisualState x:Name="HideStopProduction"/>
    257    			<VisualState x:Name="OpenChangeComponents">
    258    				<Storyboard>
    259    					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderChangeComponents" d:IsOptimized="True"/>
    260    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderChangeComponents">
    261    						<DiscreteObjectKeyFrame KeyTime="0">
    262    							<DiscreteObjectKeyFrame.Value>
    263    								<Visibility>Visible</Visibility>
    264    							</DiscreteObjectKeyFrame.Value>
    265    						</DiscreteObjectKeyFrame>
    266    					</ObjectAnimationUsingKeyFrames>
    267    				</Storyboard>
    268    			</VisualState>
    269    			<VisualState x:Name="HideChangeComponents"/>
    270    			<VisualState x:Name="ShowPunch">
    271    				<Storyboard>
    272    					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderPunch" d:IsOptimized="True"/>
    273    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderPunch">
    274    						<DiscreteObjectKeyFrame KeyTime="0">
    275    							<DiscreteObjectKeyFrame.Value>
    276    								<Visibility>Visible</Visibility>
    277    							</DiscreteObjectKeyFrame.Value>
    278    						</DiscreteObjectKeyFrame>
    279    					</ObjectAnimationUsingKeyFrames>
    280    				</Storyboard>
    281    			</VisualState>
    282    			<VisualState x:Name="HidePunch"/>
    283    		</VisualStateGroup>
    284    	</VisualStateManager.VisualStateGroups>
    285  		<Grid.ColumnDefinitions>
    286  			<ColumnDefinition Width="198"/>
    287  			<ColumnDefinition/>
    288  		</Grid.ColumnDefinitions>
    289  		<Grid.RowDefinitions>
    290  			<RowDefinition Height="104"/>
    291  			<RowDefinition/>
    292  		</Grid.RowDefinitions>
    293  		<Image x:Name="imgBackground" Grid.RowSpan="2" Grid.ColumnSpan="2" Stretch="Fill" Margin="0"/>
    294  		<Border x:Name="borderMain" Grid.Column="1" Grid.Row="1" BorderBrush="White" BorderThickness="2">
    295  			<Grid>
    296  				<Grid.ColumnDefinitions>
    297  					<ColumnDefinition Width="0.33*"/>
    298  					<ColumnDefinition Width="0.67*"/>
    299  				</Grid.ColumnDefinitions>
    300  				<Grid.RowDefinitions>
    301  					<RowDefinition Height="96"/>
    302  					<RowDefinition Height="0.401*"/>
    303  					<RowDefinition Height="0.104*"/>
    304  					<RowDefinition Height="0.494*"/>
    305  				</Grid.RowDefinitions>
    306  
    307  				<telerikGridView:RadGridView x:Name="rgvJobs" Margin="8,35,8,95" Grid.ColumnSpan="2" FontSize="18.667" IsFilteringAllowed="False" Grid.RowSpan="2">
    308  					<telerikGridView:RadGridView.Effect>
    309  						<DropShadowEffect/>
    310  					</telerikGridView:RadGridView.Effect>
    311  				</telerikGridView:RadGridView>
    312  				<telerikGridView:RadGridView x:Name="rgvComponents" Margin="8" Grid.Row="3" FontSize="18.667" ShowGroupPanel="False" FrozenColumnCount="1" DataLoaded="rgvComponents_DataLoaded">
    313  					<telerikGridView:RadGridView.Effect>
    314  						<DropShadowEffect/>
    315  					</telerikGridView:RadGridView.Effect>
    316  					<telerikGridView:RadGridView.Columns>
    317  						<telerikGridView:GridViewDataColumn>
    318  							<telerikGridView:GridViewDataColumn.CellTemplate>
    319  								<DataTemplate x:Name="dtDeleteComponent">
    320  									<Button x:Name="btDeleteComponent" Width="50" Click="DeleteComponent_Click">
    321  										<ContentControl>
    322  											<Image x:Name="imgDeleteComponent" Cursor="Hand" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="Fill" Source="delete.png"/>
    323  										</ContentControl>
    324  									</Button>
    325  								</DataTemplate>
    326  							</telerikGridView:GridViewDataColumn.CellTemplate>
    327  						</telerikGridView:GridViewDataColumn>
    328  					</telerikGridView:RadGridView.Columns>
    329  				</telerikGridView:RadGridView>
    330  				<telerikGridView:RadGridView x:Name="rgvTimes" Margin="10,8" Grid.Row="3" Grid.Column="1" FontSize="18.667" ShowGroupPanel="False" FrozenColumnCount="1">
    331  					<telerikGridView:RadGridView.Effect>
    332  						<DropShadowEffect/>
    333  					</telerikGridView:RadGridView.Effect>
    334  					<telerikGridView:RadGridView.Columns>
    335  						<telerikGridView:GridViewDataColumn>
    336  							<telerikGridView:GridViewDataColumn.CellTemplate>
    337  								<DataTemplate x:Name="dtDeleteEmploye">
    338  									<Button x:Name="btDeleteEmploye" Width="50" Click="DeleteEmploye_Click">
    339  										<ContentControl>
    340  											<Image x:Name="imgDeleteEmploye" Cursor="Hand" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="Fill" Source="delete.png" Width="32" Height="32"/>
    341  										</ContentControl>
    342  									</Button>
    343  								</DataTemplate>
    344  							</telerikGridView:GridViewDataColumn.CellTemplate>
    345  						</telerikGridView:GridViewDataColumn>
    346  						<telerikGridView:GridViewDataColumn>
    347  							<telerikGridView:GridViewDataColumn.CellTemplate>
    348  								<DataTemplate x:Name="dtStopEmploye">
    349  									<Button x:Name="btStopEmploye" Width="50" Click="StopTime_Click">
    350  										<ContentControl>
    351  											<Image x:Name="imgStopEmploye" Cursor="Hand" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="Fill" Source="stopemploye.png"/>
    352  										</ContentControl>
    353  									</Button>
    354  								</DataTemplate>
    355  							</telerikGridView:GridViewDataColumn.CellTemplate>
    356  						</telerikGridView:GridViewDataColumn>
    357  					</telerikGridView:RadGridView.Columns>
    358  				</telerikGridView:RadGridView>
    359  				<Button x:Name="btChangeMachine" Margin="8,0" Grid.Row="2" Content="Changer la machine" Cursor="Hand" Click="btChangeMachine_Click" Style="{StaticResource PolyrolButtonStyle}" Foreground="White" IsEnabled="False" Padding="3" FontSize="18.667">
    360  					<Button.Effect>
    361  						<DropShadowEffect/>
    362  					</Button.Effect>
    363  				</Button>
    364  				<Button x:Name="btStartStop" Margin="10,0" Grid.Row="2" Content="Processus" Grid.Column="1" Cursor="Hand" Click="btStartStop_Click" Style="{StaticResource PolyrolButtonStyle}" Foreground="White" FontSize="18.667" IsEnabled="False" Padding="3">
    365  					<Button.Effect>
    366  						<DropShadowEffect/>
    367  					</Button.Effect>
    368  				</Button>
    369  				<Button x:Name="btNewProduction" Height="50" Margin="9,173,0,0" VerticalAlignment="Top" Content="Créer une nouvelle production" Click="btNewProduction_Click" Cursor="Hand" FontSize="18.667" Foreground="White" Style="{StaticResource PolyrolButtonStyle}" Padding="3" Grid.Row="1">
    370  					<Button.Effect>
    371  						<DropShadowEffect/>
    372  					</Button.Effect>
    373  				</Button>
    374  				<StackPanel x:Name="spSearchDocNum" Height="23" Margin="11,8,8,0" VerticalAlignment="Top" Orientation="Horizontal">
    375  					<TextBlock Margin="0,-2,0,0" FontSize="18.667" FontWeight="Bold" Foreground="White" Text="Rechercher : " TextWrapping="Wrap"/>
    376  					<TextBox x:Name="txtSearchDocNum" Width="108" TextWrapping="Wrap" KeyDown="txtSearchDocNum_KeyDown"/>
    377  					<Button x:Name="btSearchDocNum" Cursor="Hand" Margin="6,0,0,0" Width="75" Content="Exécuter" Click="btSearchDocNum_Click"/>
    378  				</StackPanel>
    379  				<Border x:Name="borderChangeMachine" Margin="0" Opacity="0" Grid.ColumnSpan="2" Grid.RowSpan="4" Background="#FF104592" BorderThickness="2" CornerRadius="12" Visibility="Collapsed" Canvas.ZIndex="1" d:LayoutOverrides="GridBox" Width="863" Height="696" HorizontalAlignment="Center" VerticalAlignment="Center" BorderBrush="White">
    380  					<Border.Effect>
    381  						<DropShadowEffect ShadowDepth="15" Color="#FF333333"/>
    382  					</Border.Effect>
    383  					<Grid x:Name="gridChangeMachine" Margin="5">
    384  						<Rectangle Fill="#FFCECECE" StrokeThickness="0" RadiusX="4" RadiusY="3.5" Grid.RowSpan="4"/>
    385  						<Rectangle Fill="#FF104592" StrokeThickness="0" Height="39" VerticalAlignment="Top"/>
    386  						<TextBlock HorizontalAlignment="Left" Margin="8,6,0,0" VerticalAlignment="Top" Foreground="White" Text="Modification de la machine" TextWrapping="Wrap" FontSize="18.667" FontWeight="Bold"/>
    387  						<TextBlock x:Name="lblChangeMachineTitle" Height="57" HorizontalAlignment="Left" Margin="8,61,0,0" VerticalAlignment="Top" Text="CE TEXT EST CHANGÉ PAR LE CODE SELON LE JOBSTATUS = 'C' ou <> de 'C'" TextWrapping="Wrap" Width="723" FontWeight="Bold" FontSize="16"/>
    388  						<Button x:Name="btSaveAndChangeMachine" Cursor="Hand" Margin="8,0,284,8" VerticalAlignment="Bottom" Content="Enregistrer et débuter une nouvelle sous-production" Click="btSaveAndChangeMachine_Click" Height="43" Foreground="White" Style="{StaticResource PolyrolButtonStyle}" FontSize="18.667">
    389  							<Button.Effect>
    390  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    391  							</Button.Effect>
    392  						</Button>
    393  						<Button x:Name="btCancelEditBOM" HorizontalAlignment="Right" Margin="0,0,14,8" VerticalAlignment="Bottom" Width="198" Content="Annuler" Cursor="Hand" Click="btCancelEditBOM_Click" Height="43" Style="{StaticResource PolyrolButtonStyle}" Foreground="White" FontSize="18.667">
    394  							<Button.Effect>
    395  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    396  							</Button.Effect>
    397  						</Button>
    398  						<Border x:Name="borderNewTeam" Margin="8,218,230,61" BorderThickness="1" CornerRadius="12" BorderBrush="Black" Background="#FFB9B9B9">
    399  							<Border.Effect>
    400  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    401  							</Border.Effect>
    402  							<Grid x:Name="gridEditBOM" Margin="5">
    403  								<TextBlock x:Name="lblNewTeamTitle" HorizontalAlignment="Left" Margin="8,8,0,0" VerticalAlignment="Top" Foreground="#FF080808" Text="Nouvelle équipe..." TextWrapping="Wrap" FontSize="18.667" TextDecorations="Underline"/>
    404  								<ComboBox x:Name="cboMachines" Height="47" Margin="214,60,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="334" TabIndex="2" SelectedIndex="-1" FontSize="18.667">
    405  									<ComboBox.Effect>
    406  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    407  									</ComboBox.Effect>
    408  								</ComboBox>
    409  								<TextBlock Height="25" Margin="8,65,0,0" VerticalAlignment="Top" Text="Machine" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    410  								<ComboBox x:Name="cboOperator" Height="47" Margin="214,126,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="334" TabIndex="3" FontSize="18.667" SelectionChanged="cboOperator_SelectionChanged">
    411  									<ComboBox.Effect>
    412  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    413  									</ComboBox.Effect>
    414  								</ComboBox>
    415  								<TextBlock Height="25" Margin="8,136,0,0" VerticalAlignment="Top" Text="Opérateur" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    416  								<ComboBox x:Name="cboHelpOperator" Margin="214,177,0,0" HorizontalAlignment="Left" Width="334" TabIndex="4" FontSize="18.667" Height="47" VerticalAlignment="Top">
    417  									<ComboBox.Effect>
    418  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    419  									</ComboBox.Effect>
    420  								</ComboBox>
    421  								<TextBlock Margin="8,191,0,0" Text="Aide-opérateur" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment"/>
    422  								<ComboBox x:Name="cboHelp" Margin="214,229,0,0" HorizontalAlignment="Left" Width="334" TabIndex="5" FontSize="18.667" Height="47" VerticalAlignment="Top">
    423  									<ComboBox.Effect>
    424  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    425  									</ComboBox.Effect>
    426  								</ComboBox>
    427  								<TextBlock Height="25" Margin="8,239,0,0" VerticalAlignment="Top" Text="Aide" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    428  								<ComboBox x:Name="cboGeneralHelp" Height="47" Margin="214,283,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="334" TabIndex="6" FontSize="18.667">
    429  									<ComboBox.Effect>
    430  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    431  									</ComboBox.Effect>
    432  								</ComboBox>
    433  								<TextBlock Height="25" Margin="8,290,0,0" VerticalAlignment="Top" Text="Aide générale" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    434  								<ComboBox x:Name="cboOther" Height="47" Margin="214,335,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="334" TabIndex="7" FontSize="18.667">
    435  									<ComboBox.Effect>
    436  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    437  									</ComboBox.Effect>
    438  								</ComboBox>
    439  								<TextBlock Height="25" Margin="8,345,0,0" VerticalAlignment="Top" Text="Autre" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    440  							</Grid>
    441  						</Border>
    442  						<Grid x:Name="gridChangeMachineValues" Height="65" Margin="5,136,233,0" VerticalAlignment="Top">
    443  							<TextBlock Margin="0,3,152,0" VerticalAlignment="Top" Text="Nombre de matières premières utilisées:" TextWrapping="Wrap" FontSize="18.667"/>
    444  							<TextBlock Margin="0,0,152,6" VerticalAlignment="Bottom" Text="Nombre de tubes produits:" TextWrapping="Wrap" FontSize="18.667"/>
    445  							<telerikInput:RadNumericUpDown x:Name="txtMatPrem" HorizontalAlignment="Right" Minimum="0" Maximum="50000" NullValue="0.00" Width="148" FontSize="18.667" Height="30" VerticalAlignment="Top">
    446  								<telerikInput:RadNumericUpDown.Effect>
    447  									<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    448  								</telerikInput:RadNumericUpDown.Effect>
    449  							</telerikInput:RadNumericUpDown>
    450  							<telerikInput:RadNumericUpDown x:Name="txtNbTubes" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right" Minimum="0" Maximum="50000" NullValue="0.00" Width="148" Margin="0,0,0,1" FontSize="18.667" d:LayoutOverrides="VerticalAlignment">
    451  								<telerikInput:RadNumericUpDown.Effect>
    452  									<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    453  								</telerikInput:RadNumericUpDown.Effect>
    454  							</telerikInput:RadNumericUpDown>
    455  						</Grid>
    456  						<Border Height="80" HorizontalAlignment="Right" Margin="0,61,8,0" VerticalAlignment="Top" Width="80" BorderBrush="#FF104592" BorderThickness="1" CornerRadius="8">
    457  							<Image x:Name="imgEditBOM" Stretch="Fill"/>
    458  						</Border>
    459  					</Grid>
    460  				</Border>
    461  				<Border x:Name="borderNewProduction" Margin="0" Grid.ColumnSpan="2" Grid.RowSpan="4" Background="#FF104592" BorderThickness="2" CornerRadius="12" Opacity="0" Canvas.ZIndex="1" Visibility="Collapsed" Width="863" Height="696" VerticalAlignment="Center" HorizontalAlignment="Center" BorderBrush="White">
    462  					<Border.Effect>
    463  						<DropShadowEffect Color="#FF333333" ShadowDepth="15"/>
    464  					</Border.Effect>
    465  					<Grid x:Name="gridNewProduction" Margin="5">
    466  						<Rectangle Fill="#FFCECECE" StrokeThickness="0" RadiusX="4" RadiusY="3.5"/>
    467  						<Rectangle Fill="#FF104592" StrokeThickness="0" Height="39" VerticalAlignment="Top"/>
    468  						<TextBlock HorizontalAlignment="Left" Margin="7,4,0,0" VerticalAlignment="Top" Foreground="White" Text="Nouvelle production..." TextWrapping="Wrap" FontSize="18.667" FontWeight="Bold"/>
    469  						<TextBlock Height="29" HorizontalAlignment="Left" Margin="8,67,0,0" VerticalAlignment="Top" Text="No. d'ordre de production :" TextWrapping="Wrap" d:LayoutOverrides="HorizontalAlignment" FontSize="18.667" FontWeight="Bold"/>
    470  						<Button x:Name="btCreateNewProduction" Cursor="Hand" Margin="8,0,0,8" VerticalAlignment="Bottom" Content="Créer" HorizontalAlignment="Left" Width="286" Click="btCreateNewProduction_Click" Height="40" Style="{StaticResource PolyrolButtonStyle}" Foreground="White" FontSize="18.667">
    471  							<Button.Effect>
    472  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    473  							</Button.Effect>
    474  						</Button>
    475  						<Button x:Name="btCancelNewProduction" HorizontalAlignment="Right" Margin="0,0,14,8" VerticalAlignment="Bottom" Width="286" Content="Annuler" Cursor="Hand" Click="btCancelNewProduction_Click" Height="40" Style="{StaticResource PolyrolButtonStyle}" Foreground="White" FontSize="18.667">
    476  							<Button.Effect>
    477  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    478  							</Button.Effect>
    479  						</Button>
    480  						<Border x:Name="borderNewProductionTeam" Margin="8,214,234,60" BorderThickness="1" CornerRadius="12" Background="#FFB9B9B9" BorderBrush="Black">
    481  							<Border.Effect>
    482  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    483  							</Border.Effect>
    484  							<Grid x:Name="gridNewProductionTeam" Margin="5">
    485  								<TextBlock x:Name="lblNewProductionTeamTitle" HorizontalAlignment="Left" Margin="5,3,0,0" VerticalAlignment="Top" Foreground="#FF080808" Text="Nouvelle équipe..." TextWrapping="Wrap" FontSize="18.667" TextDecorations="Underline"/>
    486  								<ComboBox x:Name="cboMachinesNew" Height="47" Margin="214,46,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="334" FontFamily="Arial" FontSize="18.667">
    487  									<ComboBox.Effect>
    488  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    489  									</ComboBox.Effect>
    490  								</ComboBox>
    491  								<TextBlock Height="25" Margin="8,67,0,0" VerticalAlignment="Top" Text="Machine" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    492  								<ComboBox x:Name="cboOperatorNew" Height="47" Margin="214,114,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="334" FontFamily="Arial" FontSize="18.667" SelectionChanged="cboOperatorNew_SelectionChanged">
    493  									<ComboBox.Effect>
    494  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    495  									</ComboBox.Effect>
    496  								</ComboBox>
    497  								<TextBlock Height="25" Margin="8,128,0,0" VerticalAlignment="Top" Text="Opérateur" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    498  								<ComboBox x:Name="cboHelpOperatorNew" Margin="214,167,0,0" HorizontalAlignment="Left" Width="334" FontFamily="Arial" FontSize="18.667" Height="47" VerticalAlignment="Top">
    499  									<ComboBox.Effect>
    500  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    501  									</ComboBox.Effect>
    502  								</ComboBox>
    503  								<TextBlock Margin="8,180,0,0" Text="Aide-opérateur" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667" Height="25" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment"/>
    504  								<ComboBox x:Name="cboHelpNew" Margin="214,223,0,0" HorizontalAlignment="Left" Width="334" FontFamily="Arial" FontSize="18.667" VerticalAlignment="Top" Height="47">
    505  									<ComboBox.Effect>
    506  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    507  									</ComboBox.Effect>
    508  								</ComboBox>
    509  								<TextBlock Height="25" Margin="8,235,0,0" VerticalAlignment="Top" Text="Aide" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    510  								<ComboBox x:Name="cboGeneralHelpNew" Height="47" Margin="214,279,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="334" FontFamily="Arial" FontSize="18.667">
    511  									<ComboBox.Effect>
    512  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    513  									</ComboBox.Effect>
    514  								</ComboBox>
    515  								<TextBlock Height="25" Margin="8,291,0,0" VerticalAlignment="Top" Text="Aide générale" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    516  								<ComboBox x:Name="cboOtherNew" Height="47" Margin="214,335,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="334" FontFamily="Arial" FontSize="18.667">
    517  									<ComboBox.Effect>
    518  										<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    519  									</ComboBox.Effect>
    520  								</ComboBox>
    521  								<TextBlock Height="25" Margin="8,347,0,0" VerticalAlignment="Top" Text="Autre" TextWrapping="Wrap" HorizontalAlignment="Left" Width="193" FontSize="18.667"/>
    522  							</Grid>
    523  						</Border>
    524  						<TextBlock Height="22" HorizontalAlignment="Left" Margin="11,143,0,0" VerticalAlignment="Top" Text="Item :" TextWrapping="Wrap" d:LayoutOverrides="HorizontalAlignment" FontSize="18.667" FontWeight="Bold"/>
    525  						<TextBlock Height="25" HorizontalAlignment="Left" Margin="11,175,0,0" VerticalAlignment="Top" Text="Client :" TextWrapping="Wrap" d:LayoutOverrides="HorizontalAlignment" FontSize="18.667" FontWeight="Bold"/>
    526  						<TextBlock Height="27" Margin="370,175,0,0" VerticalAlignment="Top" Text="Date Due:" TextWrapping="Wrap" FontSize="18.667" FontWeight="Bold" d:LayoutOverrides="Width" HorizontalAlignment="Left"/>
    527  						<TextBlock x:Name="lblItemCode" Height="28" HorizontalAlignment="Left" Margin="89,143,0,0" VerticalAlignment="Top" Text="lblItemCode" TextWrapping="Wrap" d:LayoutOverrides="HorizontalAlignment" FontSize="18.667" Width="180"/>
    528  						<TextBlock x:Name="lblCustomer" Height="25" HorizontalAlignment="Left" Margin="89,175,0,0" VerticalAlignment="Top" Text="lblCustomer" TextWrapping="Wrap" d:LayoutOverrides="HorizontalAlignment" FontSize="18.667" Width="264"/>
    529  						<TextBlock x:Name="lblDueDate" Height="25" Margin="487,175,0,0" VerticalAlignment="Top" Text="lblDueDate" TextWrapping="Wrap" FontSize="18.667" HorizontalAlignment="Left"/>
    530  						<telerik:RadDropDownButton x:Name="rddbOP" Height="47" Margin="304,59,211,0" VerticalAlignment="Top" HorizontalContentAlignment="Left" Cursor="Hand" FontSize="18.667" Width="334">
    531  							<telerik:RadDropDownButton.Effect>
    532  								<DropShadowEffect Color="#FF333333" ShadowDepth="8"/>
    533  							</telerik:RadDropDownButton.Effect>
    534  							<telerik:RadDropDownButton.DropDownContent>
    535  								<telerikGridView:RadGridView x:Name="rgvOPs" AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False" CanUserReorderColumns="False" IsFilteringAllowed="False" ShowGroupPanel="False" SelectionMode="Single" SelectionChanged="rgvOPs_SelectionChanged" Width="442" Height="380">
    536  									<telerikGridView:RadGridView.Effect>
    537  										<DropShadowEffect Color="#FF333333" ShadowDepth="15"/>
    538  									</telerikGridView:RadGridView.Effect>
    539  								</telerikGridView:RadGridView>
    540  							</telerik:RadDropDownButton.DropDownContent>
    541  						</telerik:RadDropDownButton>
    542  						<Border Height="80" HorizontalAlignment="Right" Margin="0,59,8,0" VerticalAlignment="Top" Width="80" BorderBrush="#FF104592" BorderThickness="1" CornerRadius="8">
    543  							<Image x:Name="imgNewProduction" Margin="0" Stretch="Fill"/>
    544  						</Border>
    545  					</Grid>
    546  				</Border>
    547  				<Border x:Name="borderStopProduction" Margin="0" Grid.ColumnSpan="2" Grid.RowSpan="4" Background="#FF104592" BorderThickness="2" CornerRadius="12" Opacity="0" Visibility="Collapsed" Width="914" Height="367" HorizontalAlignment="Center" VerticalAlignment="Center" BorderBrush="White">
    548  					<Border.Effect>
    549  						<DropShadowEffect ShadowDepth="15" Color="#FF333333"/>
    550  					</Border.Effect>
    551  					<Grid x:Name="gridStopProduction" Margin="5">
    552  						<Rectangle Fill="#FFCECECE" StrokeThickness="0" RadiusX="4" RadiusY="3.5"/>
    553  						<Rectangle Fill="#FF104592" StrokeThickness="0" Height="39" VerticalAlignment="Top"/>
    554  						<TextBlock HorizontalAlignment="Left" Margin="7,5,0,0" VerticalAlignment="Top" Foreground="White" Text="Arrêt de la production..." TextWrapping="Wrap" FontSize="18.667" FontWeight="Bold"/>
    555  						<TextBlock Height="39" HorizontalAlignment="Left" Margin="8,51,0,0" VerticalAlignment="Top" Text="Veuillez saisir les valeurs suivantes :" TextWrapping="Wrap" FontWeight="Bold" FontSize="18.667"/>
    556  						<TextBlock HorizontalAlignment="Left" Margin="8,113,0,0" VerticalAlignment="Top" Text="Nombre de matières premières utilisées:" TextWrapping="Wrap" FontSize="18.667"/>
    557  						<TextBlock HorizontalAlignment="Left" Margin="8,144,0,0" VerticalAlignment="Top" Text="Nombre de tubes produits:" TextWrapping="Wrap" d:LayoutOverrides="VerticalAlignment" FontSize="18.667"/>
    558  						<Button x:Name="btSaveAndStopProduction" Cursor="Hand" Margin="11,304,363,0" VerticalAlignment="Top" Content="Enregistrer et arrêter la production" Height="40" Foreground="White" Style="{StaticResource PolyrolButtonStyle}" Click="btSaveAndStopProduction_Click" FontSize="18.667">
    559  							<Button.Effect>
    560  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    561  							</Button.Effect>
    562  						</Button>
    563  						<Button x:Name="btCancelStopProduction" HorizontalAlignment="Right" Margin="0,304,8,0" VerticalAlignment="Top" Width="338" Content="Annuler la modification" Cursor="Hand" Height="40" Style="{StaticResource PolyrolButtonStyle}" Foreground="White" Click="btCancelStopProduction_Click" FontSize="18.667">
    564  							<Button.Effect>
    565  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    566  							</Button.Effect>
    567  						</Button>
    568  						<telerikInput:RadNumericUpDown x:Name="txtMatPremSP" Height="30" Margin="397,111,0,0" VerticalAlignment="Top" Minimum="0" Maximum="50000" NullValue="0.00" FontSize="18.667" HorizontalAlignment="Left" Width="238">
    569  							<telerikInput:RadNumericUpDown.Effect>
    570  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    571  							</telerikInput:RadNumericUpDown.Effect>
    572  						</telerikInput:RadNumericUpDown>
    573  						<telerikInput:RadNumericUpDown x:Name="txtNbTubesSP" Margin="397,146,0,0" VerticalAlignment="Top" Minimum="0" Maximum="50000" NullValue="0.00" Height="30" FontSize="18.667" HorizontalAlignment="Left" Width="238">
    574  							<telerikInput:RadNumericUpDown.Effect>
    575  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    576  							</telerikInput:RadNumericUpDown.Effect>
    577  						</telerikInput:RadNumericUpDown>
    578  						<Border HorizontalAlignment="Right" Margin="0,52,16,0" Width="80" BorderBrush="#FF104592" BorderThickness="1" CornerRadius="8" Height="80" VerticalAlignment="Top">
    579  							<Image x:Name="imgStopProduction" Margin="0" Stretch="Fill"/>
    580  						</Border>
    581  					</Grid>
    582  				</Border>
    583  				<Border x:Name="borderChangeComponents" Margin="0" Grid.ColumnSpan="2" Grid.RowSpan="4" Background="#FF104592" BorderThickness="2" CornerRadius="12" Opacity="0" Visibility="Collapsed" Width="914" Height="367" HorizontalAlignment="Center" VerticalAlignment="Center" BorderBrush="White">
    584  					<Border.Effect>
    585  						<DropShadowEffect ShadowDepth="15" Color="#FF333333"/>
    586  					</Border.Effect>
    587  					<Grid x:Name="gridChangeComponents" Margin="5">
    588  						<Rectangle Fill="#FFCECECE" StrokeThickness="0" RadiusX="4" RadiusY="3.5"/>
    589  						<Rectangle Fill="#FF104592" StrokeThickness="0" Height="39" VerticalAlignment="Top"/>
    590  						<TextBlock HorizontalAlignment="Left" Margin="7,5,0,0" VerticalAlignment="Top" Foreground="White" Text="Modification de la recette..." TextWrapping="Wrap" FontSize="18.667" FontWeight="Bold"/>
    591  						<TextBlock Height="56" HorizontalAlignment="Left" Margin="8,51,0,0" VerticalAlignment="Top" Text="Vous avez modifié la recette. Un tel changement implique de spécifier les valeurs ci-dessous pour la production en cours." TextWrapping="Wrap" FontWeight="Bold" FontSize="18.667" Width="792"/>
    592  						<TextBlock HorizontalAlignment="Left" Margin="8,131,0,0" VerticalAlignment="Top" Text="Nombre de matières premières utilisées:" TextWrapping="Wrap" FontSize="18.667"/>
    593  						<TextBlock HorizontalAlignment="Left" Margin="8,162,0,0" VerticalAlignment="Top" Text="Nombre de tubes produits:" TextWrapping="Wrap" FontSize="18.667"/>
    594  						<Button x:Name="btSaveChangeComponents" Cursor="Hand" Margin="11,304,363,0" VerticalAlignment="Top" Content="Enregistrer" Height="40" Foreground="White" Style="{StaticResource PolyrolButtonStyle}" FontSize="18.667" Click="btSaveChangeComponents_Click">
    595  							<Button.Effect>
    596  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    597  							</Button.Effect>
    598  						</Button>
    599  						<Button x:Name="btCancelChangeComponents" HorizontalAlignment="Right" Margin="0,304,8,0" VerticalAlignment="Top" Width="338" Content="Annuler" Cursor="Hand" Height="40" Style="{StaticResource PolyrolButtonStyle}" Foreground="White" FontSize="18.667" Click="btCancelChangeComponents_Click">
    600  							<Button.Effect>
    601  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    602  							</Button.Effect>
    603  						</Button>
    604  						<telerikInput:RadNumericUpDown x:Name="txtMatPremCC" Height="30" Margin="397,129,0,0" VerticalAlignment="Top" Minimum="0" Maximum="50000" NullValue="0.00" FontSize="18.667" HorizontalAlignment="Left" Width="238" ValueChanged="Components_ValueChanged">
    605  							<telerikInput:RadNumericUpDown.Effect>
    606  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    607  							</telerikInput:RadNumericUpDown.Effect>
    608  						</telerikInput:RadNumericUpDown>
    609  						<telerikInput:RadNumericUpDown x:Name="txtNbTubesCC" Margin="397,164,0,159" Minimum="0" Maximum="50000" NullValue="0.00" FontSize="18.667" HorizontalAlignment="Left" Width="238" ValueChanged="Components_ValueChanged">
    610  							<telerikInput:RadNumericUpDown.Effect>
    611  								<DropShadowEffect Color="#FF292929" ShadowDepth="8"/>
    612  							</telerikInput:RadNumericUpDown.Effect>
    613  						</telerikInput:RadNumericUpDown>
    614  						<Border HorizontalAlignment="Right" Margin="0,52,16,0" Width="80" BorderBrush="#FF104592" BorderThickness="1" CornerRadius="8" Height="80" VerticalAlignment="Top">
    615  							<Image x:Name="imgChangeComponents" Margin="0" Stretch="Fill"/>
    616  						</Border>
    617  						<TextBlock x:Name="lblStopEmployes" HorizontalAlignment="Left" Text="Le temps des employés sera stoppé sur la sous-production courante" TextWrapping="Wrap" FontSize="18.667" VerticalAlignment="Bottom" Margin="8,0,0,100" Visibility="Collapsed"/>
    618  					</Grid>
    619  				</Border>
    620  				<Button x:Name="btEraseAll" Cursor="Hand" Height="25" HorizontalAlignment="Right" Margin="0,0,8,66" VerticalAlignment="Bottom" Width="178" Content="Erase all" Grid.Column="1" Click="btEraseAll_Click" Grid.Row="1"/>
    621  				<Border x:Name="borderTimeError" Height="96" Margin="10,0,10,8" VerticalAlignment="Bottom" Grid.Column="1" Grid.Row="3" BorderBrush="Red" BorderThickness="5" Background="#FF727272" Visibility="Collapsed">
    622  					<Grid x:Name="gridTimeError" Background="White" Margin="5">
    623  						<TextBlock x:Name="lblTimeErrorMessage" Text="lblTimeErrorMessage" TextWrapping="Wrap" Foreground="Red" FontWeight="Bold" Margin="71,8,8,8"/>
    624  						<Image x:Name="imgTimeErrorIcon" HorizontalAlignment="Left" Width="43" Margin="8,8,0,27"/>
    625  					</Grid>
    626  				</Border>
    627  				<Border x:Name="borderComponentError" Height="96" Margin="8,0,0,8" VerticalAlignment="Bottom" Grid.Row="3" BorderBrush="Red" BorderThickness="5" Background="#FF727272" Visibility="Collapsed">
    628  					<Grid x:Name="gridComponentError" Background="White" Margin="5">
    629  						<TextBlock x:Name="lblComponentErrorMessage" Text="lblComponentErrorMessage" TextWrapping="Wrap" Foreground="Red" FontWeight="Bold" Margin="71,8,8,8"/>
    630  						<Image x:Name="imgComponentErrorIcon" HorizontalAlignment="Left" Width="43" Margin="8,8,0,27"/>
    631  					</Grid>
    632  				</Border>
    633  			</Grid>
    634  		</Border>
    635  		<PolyrolControls:Logo HorizontalAlignment="Left" Margin="-105,-46,0,0" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Top" d:LayoutOverrides="GridBox" Grid.ColumnSpan="2">
    636  			<PolyrolControls:Logo.Effect>
    637  				<DropShadowEffect/>
    638  			</PolyrolControls:Logo.Effect>
    639  			<PolyrolControls:Logo.RenderTransform>
    640  				<TransformGroup>
    641  					<ScaleTransform ScaleX="0.6" ScaleY="0.5"/>
    642  					<SkewTransform/>
    643  					<RotateTransform/>
    644  					<TranslateTransform/>
    645  				</TransformGroup>
    646  			</PolyrolControls:Logo.RenderTransform>
    647  		</PolyrolControls:Logo>
    648  		<Image x:Name="imgFortsum" HorizontalAlignment="Right" Width="178" Grid.Column="1" Margin="0,8,8,33" Cursor="Hand" MouseLeftButtonDown="imgFortsum_MouseLeftButtonDown">
    649  			<Image.Effect>
    650  				<DropShadowEffect/>
    651  			</Image.Effect>
    652  		</Image>
    653  		<TextBlock Margin="0,34,0,33" FontSize="24" FontWeight="Bold" Foreground="White" Text="Gestion de la production" TextWrapping="Wrap" Grid.Column="1" HorizontalAlignment="Center">
    654  			<TextBlock.Effect>
    655  				<DropShadowEffect/>
    656  			</TextBlock.Effect>
    657  		</TextBlock>
    658  		<HyperlinkButton x:Name="hlbPunch" Content="Entrée / Sortie" Height="36" Margin="8,15,8,0" Grid.Row="1" VerticalAlignment="Top" FontSize="24" Click="hlbPunch_Click" Foreground="{StaticResource MenuColor}">
    659  			<HyperlinkButton.Effect>
    660  				<DropShadowEffect ShadowDepth="3"/>
    661  			</HyperlinkButton.Effect>
    662  		</HyperlinkButton>
    663  		<HyperlinkButton x:Name="hlbProduction" Content="Production" Height="36" Margin="8,57,8,0" Grid.Row="1" VerticalAlignment="Top" FontSize="24" Click="hlbProduction_Click" Foreground="#FF1282E4">
    664  			<HyperlinkButton.Effect>
    665  				<DropShadowEffect ShadowDepth="3"/>
    666  			</HyperlinkButton.Effect>
    667  		</HyperlinkButton>
    668  		<HyperlinkButton x:Name="hlbApprobation" Content="Approbation" Height="36" Margin="8,107,8,0" Grid.Row="1" VerticalAlignment="Top" FontSize="24" Click="hlbApprobation_Click" Foreground="#FF1282E4">
    669  			<HyperlinkButton.Effect>
    670  				<DropShadowEffect ShadowDepth="3"/>
    671  			</HyperlinkButton.Effect>
    672  		</HyperlinkButton>
    673  		<HyperlinkButton x:Name="hlbReport" Content="Rapport" Height="36" Margin="8,157,8,0" Grid.Row="1" VerticalAlignment="Top" FontSize="24" Click="hlbReport_Click" Foreground="#FF1282E4">
    674  			<HyperlinkButton.Effect>
    675  				<DropShadowEffect ShadowDepth="3"/>
    676  			</HyperlinkButton.Effect>
    677  		</HyperlinkButton>
    678  	  	<Border x:Name="borderPunch" BorderBrush="Black" BorderThickness="3" Background="#FF6C9DB6" CornerRadius="20" Width="700" Height="450" Grid.ColumnSpan="2" Margin="0" Grid.RowSpan="2" Opacity="0" IsHitTestVisible="False" Visibility="Collapsed">
    679  	  		<Border.Effect>
    680  	  			<DropShadowEffect Color="#FF3B3B3B" ShadowDepth="17"/>
    681  	  		</Border.Effect>
    682  	  		<Grid x:Name="gridPunch" Margin="5">
    683  	  			<Path Data="M-8.0318604,62 L691.67114,62" Fill="Black" Height="3" Margin="-8.5,61.5,-8.167,0" StrokeStartLineCap="Flat" Stretch="Fill" StrokeEndLineCap="Flat" Stroke="Black" StrokeThickness="3" StrokeMiterLimit="10" StrokeLineJoin="Miter" UseLayoutRounding="False" VerticalAlignment="Top"/>
    684  	  			<TextBlock x:Name="lblDatePunch" HorizontalAlignment="Right" Height="23" Margin="0,8,8,0" TextWrapping="Wrap" Text="lblDatePunch" VerticalAlignment="Top" FontSize="16" TextAlignment="Right" Foreground="White" FontWeight="Bold">
    685  	  				<TextBlock.Effect>
    686  	  					<DropShadowEffect/>
    687  	  				</TextBlock.Effect>
    688  	  			</TextBlock>
    689  	  			<TextBlock x:Name="lblHourPunch" Height="23" Margin="340,31,8,0" TextWrapping="Wrap" Text="lblHourPunch" VerticalAlignment="Top" FontSize="16" TextAlignment="Right" HorizontalAlignment="Right" Foreground="White" FontWeight="Bold">
    690  	  				<TextBlock.Effect>
    691  	  					<DropShadowEffect/>
    692  	  				</TextBlock.Effect>
    693  	  			</TextBlock>
    694  	  			<TextBlock x:Name="lblEmployeNum" Height="23" Margin="77,120,0,0" TextWrapping="Wrap" Text="Numéro d'employé :" VerticalAlignment="Top" FontSize="16" TextAlignment="Right" HorizontalAlignment="Left" Foreground="White" FontWeight="Bold">
    695  	  				<TextBlock.Effect>
    696  	  					<DropShadowEffect/>
    697  	  				</TextBlock.Effect>
    698  	  			</TextBlock>
    699  	  			<TextBox x:Name="txtEmployeNum" Height="26" Margin="276,119,210,0" TextWrapping="Wrap" VerticalAlignment="Top" KeyDown="txtEmployeNum_KeyDown">
    700  	  				<TextBox.Effect>
    701  	  					<DropShadowEffect/>
    702  	  				</TextBox.Effect>
    703  	  			</TextBox>
    704  	  			<TextBlock x:Name="lblEmployeName" Height="23" Margin="77,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="16" TextAlignment="Right" HorizontalAlignment="Left" Foreground="White" FontWeight="Bold">
    705  	  				<TextBlock.Effect>
    706  	  					<DropShadowEffect/>
    707  	  				</TextBlock.Effect>
    708  	  			</TextBlock>
    709  	  			<TextBlock x:Name="lblEmployePunchDate" Margin="77,198,0,213" TextWrapping="Wrap" FontSize="16" TextAlignment="Right" Foreground="White" FontWeight="Bold" HorizontalAlignment="Left">
    710  	  				<TextBlock.Effect>
    711  	  					<DropShadowEffect/>
    712  	  				</TextBlock.Effect>
    713  	  			</TextBlock>
    714  	  			<Button x:Name="btPunch" Content="Entrée/Sortie" Height="40" Margin="32,0,0,39" VerticalAlignment="Bottom" Style="{StaticResource PolyrolButtonStyle}" Click="btPunch_Click" Foreground="White" FontSize="16" HorizontalAlignment="Left" Width="271" Cursor="Hand" IsEnabled="False">
    715  	  				<Button.Effect>
    716  	  					<DropShadowEffect/>
    717  	  				</Button.Effect>
    718  	  			</Button>
    719  	  			<Button x:Name="btCancelPunch" Content="Annuler" HorizontalAlignment="Right" Height="40" Margin="0,0,20,39" VerticalAlignment="Bottom" Width="273" Style="{StaticResource PolyrolButtonStyle}" Foreground="White" Click="btCancelPunch_Click" FontSize="16" Cursor="Hand">
    720  	  				<Button.Effect>
    721  	  					<DropShadowEffect/>
    722  	  				</Button.Effect>
    723  	  			</Button>
    724  	  			<Image x:Name="imgPunch" HorizontalAlignment="Left" Height="48" Margin="8,8,0,0" VerticalAlignment="Top" Width="48" Stretch="Fill">
    725  	  				<Image.Effect>
    726  	  					<DropShadowEffect/>
    727  	  				</Image.Effect>
    728  	  			</Image>
    729  	  			<TextBlock x:Name="lblError" HorizontalAlignment="Right" Height="25" Margin="0,120,8,0" TextWrapping="Wrap" Text="Employé non trouvé..." VerticalAlignment="Top" Width="187" FontSize="14.667" Foreground="#FFA92222" FontWeight="Bold" Visibility="Collapsed"/>
    730  	  		</Grid>
    731  	  	</Border>
    732  	</Grid>
    733  </UserControl>
    734  
    
     

     

     

    Tuesday, May 11, 2010 12:04 PM
  • Here is a basic example on how to create a usercontrol with custom states.

    MyControl.xaml:

    <UserControl x:Class="SilverlightApplication28.MyControl"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="VisualStateGroup">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="00:00:00.2000000">
                            <VisualTransition.GeneratedEasingFunction>
                                <BackEase EasingMode="EaseOut"/>
                            </VisualTransition.GeneratedEasingFunction>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal">
                    </VisualState>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimation To="Blue" Storyboard.TargetName="rect" Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="rect" Stretch="Fill" Fill="Red" />
        </Grid>
    </UserControl>
     

    MyControl.xaml.cs:

     

    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Input;
    
    namespace SilverlightApplication28
    {
        public partial class MyControl : UserControl
        {
            public MyControl()
            {
                InitializeComponent();
    
                this.MouseEnter += new MouseEventHandler(UserControl_MouseEnter);
                this.MouseLeave += new MouseEventHandler(UserControl_MouseLeave);
            }
    
            void UserControl_MouseLeave(object sender, MouseEventArgs e)
            {
                VisualStateManager.GoToState(this, "Normal", true);
            }
    
            void UserControl_MouseEnter(object sender, MouseEventArgs e)
            {
                VisualStateManager.GoToState(this, "MouseOver", true);
            }
        }
    }
     

    MainPage.xaml:

    <UserControl x:Class="SilverlightApplication28.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:SilverlightApplication28"         
        >
    
        <local:MyControl Margin="0" />
    </UserControl>

     

    Tuesday, May 11, 2010 12:32 PM
  • I don't have any trouble with this.  I know how it works, if I start a new project there's no problem at all.  My problem is in my actual xaml.
    What's going on and what I have to look for to solve it ?
    Everything looks as expected.

     

    Tuesday, May 11, 2010 12:40 PM
  • In your code, you are starting a storyboard called "Control", but I didn't see that in the XAML.

     

    VisualStateManager.GotoState(this, "Control", true) 
     
    Tuesday, May 11, 2010 12:49 PM
  • No, 'Control' was just an example given

    but after all I solved my problem by moving all my controls having States in the LayoutRoot.

    Seems there's really a problem when you try to use VisualStateManager by C# code to execute a state that is deep like in

    LayoutRoot
        Border
            Grid
                Border
                    Grid

    Can't tel if it's really the problem but all I can say is that after moving all my controls up to the LayoutRoot level, it worked...

    Tuesday, May 11, 2010 1:07 PM
  •  you can also create a property in the class where your storyboard lives

    as follows

    public Storyboard ScaleXDollarBag

    {

          get { return this.sbScaleXDollarBag; }

    }

     

    and then you can reference it from the other page using this property

    Tuesday, May 11, 2010 1:12 PM
  • The following xaml works based on the given tree structure.

    LayoutRoot
        Border
            Grid
                Border
                    Grid

    DId you mention that your VSM works in LayoutRoot but not if it is deep inside (Border -> Grid -> Border -> Grid).  What if you isolated those components into its own UserControl so that the root would hold the VSM.

      

    <Grid x:Name="LayoutRoot">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="VisualStateGroup">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="00:00:00.2000000">
                            <VisualTransition.GeneratedEasingFunction>
                                <BackEase EasingMode="EaseOut"/>
                            </VisualTransition.GeneratedEasingFunction>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal">
                    </VisualState>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimation To="Blue" Storyboard.TargetName="rect" Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border>
                <Grid>
                    <Border>
                        <Rectangle x:Name="rect" Stretch="Fill" Fill="Red" />
                    </Border>
                </Grid>
            </Border>
        </Grid>
     

     

    Tuesday, May 11, 2010 1:30 PM
  • :) What else I can say.  As soon as I moved from Border - Grid - Border - Grid up to the LayoutRoot level, it worked.

     

    Tuesday, May 11, 2010 6:06 PM
  • There's definitely something wrong as I'm not alone having this error.  It's like if the VisualStateManager can't find the TargetName in the VisualTree for some unknown reasons.  It's not obvious for me and I don't have time to play trying to find out the real cause.

     

    Tuesday, May 11, 2010 6:08 PM
  • I've not been able to reproduce it but at a little scale, with a new project, I replicated what I did.

    First, put your state as normal in

    LayoutRoot
        Grid
            Border
                Grid
                    Border (Animated one with State)

    Now take the LayoutRoot and Group it into a Grid then, delete the name LayoutRoot and rename the new grid LayoutRoot and look at your state.  The animation is already broken at that time.  Reason ? I don't know  It plays but all fucked up.

    Looks like there's something kept outside the xaml because there's no reason for this behaviour since the animation did not change and when I try to play it in Blend 4, the animation takes a long time to start and doesn't even look like the initial animation.

    The good xaml :

     

    <UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    	xmlns:ec="http://schemas.microsoft.com/expression/2010/controls"
    	xmlns:local="clr-namespace:Repro"
    	xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    	xmlns:System="clr-namespace:System;assembly=mscorlib"
    	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"
    	x:Class="Repro.MainPage"
        mc:Ignorable="d"
        d:DesignHeight="470" d:DesignWidth="754">
    
        <Grid x:Name="LayoutRoot">
        	<VisualStateManager.VisualStateGroups>
        		<VisualStateGroup x:Name="VisualStateGroup" ei:ExtendedVisualStateManager.UseFluidLayout="True">
        			<VisualStateGroup.Transitions>
        				<VisualTransition GeneratedDuration="0:0:0.5"/>
        				<VisualTransition GeneratedDuration="0:0:0.5" To="ShowBorder">
        					<VisualTransition.GeneratedEasingFunction>
        						<BounceEase EasingMode="EaseOut"/>
        					</VisualTransition.GeneratedEasingFunction>
        					<Storyboard>
        						<DoubleAnimation Duration="0:0:2" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderBlackBorder"/>
        					</Storyboard>
        				</VisualTransition>
        				<VisualTransition From="ShowBorder" GeneratedDuration="0:0:0.5">
        					<VisualTransition.GeneratedEasingFunction>
        						<BounceEase EasingMode="EaseOut" Bounces="1" Bounciness="1"/>
        					</VisualTransition.GeneratedEasingFunction>
        					<Storyboard>
        						<DoubleAnimation Duration="0:0:0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderBlackBorder"/>
        					</Storyboard>
        				</VisualTransition>
        				<VisualTransition GeneratedDuration="0:0:0.5" To="HideBorder"/>
        				<VisualTransition From="HideBorder" GeneratedDuration="0:0:0.5"/>
        			</VisualStateGroup.Transitions>
        			<VisualState x:Name="ShowBorder">
        				<Storyboard>
        					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderBlackBorder" d:IsOptimized="True"/>
        					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBlackBorder">
        						<DiscreteObjectKeyFrame KeyTime="0">
        							<DiscreteObjectKeyFrame.Value>
        								<Visibility>Visible</Visibility>
        							</DiscreteObjectKeyFrame.Value>
        						</DiscreteObjectKeyFrame>
        					</ObjectAnimationUsingKeyFrames>
        				</Storyboard>
        			</VisualState>
        			<VisualState x:Name="HideBorder"/>
        		</VisualStateGroup>
        	</VisualStateManager.VisualStateGroups>
        	<Grid.ColumnDefinitions>
        		<ColumnDefinition Width="347"/>
        		<ColumnDefinition/>
        	</Grid.ColumnDefinitions>
        	<Grid.RowDefinitions>
        		<RowDefinition Height="69"/>
        		<RowDefinition/>
        	</Grid.RowDefinitions>
        	<VisualStateManager.CustomVisualStateManager>
        		<ei:ExtendedVisualStateManager/>
        	</VisualStateManager.CustomVisualStateManager>
        	<Grid Margin="0" Grid.Row="2" Grid.Column="2">
        		<Border BorderBrush="Black" BorderThickness="2">
        			<Grid>
        				<Border x:Name="borderBlackBorder" BorderBrush="Black" BorderThickness="1" Margin="65,124,52,136" Background="Black" Opacity="0" Visibility="Collapsed"/>
        			</Grid>
        		</Border>
        	</Grid>
        	<Button x:Name="btShowBorder" Content="Show Black Border" Margin="8,8,155,0" Grid.Row="1" Height="31" VerticalAlignment="Top" Cursor="Hand" Click="btShowBorder_Click"/>
        </Grid>
    </UserControl>
    

     

    The bad xaml :

    <UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    	xmlns:ec="http://schemas.microsoft.com/expression/2010/controls"
    	xmlns:local="clr-namespace:Repro"
    	xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    	xmlns:System="clr-namespace:System;assembly=mscorlib"
    	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"
    	x:Class="Repro.MainPage"
        mc:Ignorable="d"
        d:DesignHeight="470" d:DesignWidth="754">
    
        <Grid x:Name="LayoutRoot">
    		<VisualStateManager.VisualStateGroups>
    			<VisualStateGroup x:Name="VisualStateGroup" ei:ExtendedVisualStateManager.UseFluidLayout="True">
    				<VisualStateGroup.Transitions>
    					<VisualTransition GeneratedDuration="0:0:0.5"/>
    					<VisualTransition GeneratedDuration="0:0:0.5" To="ShowBorder">
    						<VisualTransition.GeneratedEasingFunction>
    							<BounceEase EasingMode="EaseOut"/>
    						</VisualTransition.GeneratedEasingFunction>
    						<Storyboard>
    							<DoubleAnimation Duration="0:0:2" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderBlackBorder"/>
    						</Storyboard>
    					</VisualTransition>
    					<VisualTransition From="ShowBorder" GeneratedDuration="0:0:0.5">
    						<VisualTransition.GeneratedEasingFunction>
    							<BounceEase EasingMode="EaseOut" Bounces="1" Bounciness="1"/>
    						</VisualTransition.GeneratedEasingFunction>
    						<Storyboard>
    							<DoubleAnimation Duration="0:0:0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderBlackBorder"/>
    						</Storyboard>
    					</VisualTransition>
    					<VisualTransition GeneratedDuration="0:0:0.5" To="HideBorder"/>
    					<VisualTransition From="HideBorder" GeneratedDuration="0:0:0.5"/>
    				</VisualStateGroup.Transitions>
    				<VisualState x:Name="ShowBorder">
    					<Storyboard>
    						<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderBlackBorder" d:IsOptimized="True"/>
    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBlackBorder">
    							<DiscreteObjectKeyFrame KeyTime="0">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Visible</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    						</ObjectAnimationUsingKeyFrames>
    					</Storyboard>
    				</VisualState>
    				<VisualState x:Name="HideBorder"/>
    			</VisualStateGroup>
    		</VisualStateManager.VisualStateGroups>
    
    		<Grid>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="347"/>
    				<ColumnDefinition/>
    			</Grid.ColumnDefinitions>
    			<Grid.RowDefinitions>
    				<RowDefinition Height="69"/>
    				<RowDefinition/>
    			</Grid.RowDefinitions>
    			<VisualStateManager.CustomVisualStateManager>
    				<ei:ExtendedVisualStateManager/>
    			</VisualStateManager.CustomVisualStateManager>
    			<Grid Margin="0" Grid.Row="2" Grid.Column="2">
    				<Border BorderBrush="Black" BorderThickness="2">
    					<Grid>
    						<Border x:Name="borderBlackBorder" BorderBrush="Black" BorderThickness="1" Margin="65,124,52,136" Background="Black" Opacity="0" Visibility="Collapsed"/>
    					</Grid>
    				</Border>
    			</Grid>
    			<Button x:Name="btShowBorder" Content="Show Black Border" Margin="8,8,155,0" Grid.Row="1" Height="31" VerticalAlignment="Top" Cursor="Hand" Click="btShowBorder_Click"/>
    		</Grid>
    	</Grid>
    </UserControl>
    
     
    Tuesday, May 11, 2010 6:57 PM