Expander ad item of a listbox

2 posts, 0 answers
  1. Adrien
    Adrien avatar
    1 posts
    Member since:
    Feb 2013

    Posted 27 Feb 2013 Link to this post

    Hello Guys

     

    I need your help since I get the following message in my Silverlight application:

     

    -----------------------------------------

    {System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Value does not fall within the expected range.

       à MS.Internal.XcpImports.CheckHResult(UInt32 hr)

       à MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)

       à MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)

       à System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)

       à System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)

       à System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)

       à System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)

       à System.Windows.Data.BindingExpression.SendDataToTarget()

       à System.Windows.Data.BindingExpression.SourceAcquired()

       à System.Windows.Data.Debugging.BindingBreakPoint.<>c__DisplayClass4.<BreakOnSharedType>b__3()

       --- Fin de la trace de la pile d'exception interne ---

       à System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

       à System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

       à System.Delegate.DynamicInvokeImpl(Object[] args)

       à System.Delegate.DynamicInvoke(Object[] args)

       à StylesBudgetxaml.BindingOperation(Object BindingState, Int32 , Action )}


    ----------------------------------------------------------------

     

    I’m using a listbox where I’ve changed the items into Telerik RadExpanders.

     

    <ListBox ItemsSource="{Binding FaqItems, ElementName=Root}" ItemTemplate="{StaticResource FAQListBoxItems}" ItemContainerStyle="{StaticResource FAQListBoxItemStyle}" Width="650" ScrollViewer.HorizontalScrollBarVisibility="Disabled"/>
     
     
    <SolidColorBrush x:Key="Expander_Background" Color="#00FFFFFF"/>
        <SolidColorBrush x:Key="Expander_BorderBrush" Color="#00FFFFFF"/>
        <Thickness x:Key="Expander_BorderThickness">0</Thickness>
        <SolidColorBrush x:Key="ControlInnerBorder_Normal" Color="#FFFFFFFF"/>
        <SolidColorBrush x:Key="ControlElement_Normal" Color="#FF000000"/>
        <SolidColorBrush x:Key="ControlOuterBorder_Focused" Color="#FFFFC92B"/>
     
        <ControlTemplate x:Key="ToggleTemplate" TargetType="telerik:RadToggleButton">
            <Grid>
               <VisualStateManager.VisualStateGroups>
                   <VisualStateGroup x:Name="FocusStates">
                       <VisualStateGroup.Transitions>
                          <VisualTransition GeneratedDuration="0:0:0.2" To="Focused"/>
                          <VisualTransition GeneratedDuration="0:0:0.2" To="Unfocused"/>
                       </VisualStateGroup.Transitions>
                       <VisualState x:Name="Unfocused"/>
                       <VisualState x:Name="Focused">
                          <Storyboard>
                              <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusDecorator">
                                  <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                     <DiscreteObjectKeyFrame.Value>
                                         <Visibility>Visible</Visibility>
                                     </DiscreteObjectKeyFrame.Value>
                                  </DiscreteObjectKeyFrame>
                              </ObjectAnimationUsingKeyFrames>
                          </Storyboard>
                       </VisualState>
                   </VisualStateGroup>
               </VisualStateManager.VisualStateGroups>
               <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
               <Rectangle x:Name="FocusDecorator" IsHitTestVisible="false" Stroke="{StaticResource ControlOuterBorder_Focused}" StrokeThickness="1" StrokeDashArray="1 2" Visibility="Collapsed"/>
            </Grid>
        </ControlTemplate>
     
     
        <CornerRadius x:Key="Expander_BorderRadius">3</CornerRadius>
        <SolidColorBrush x:Key="ControlOuterBorder_Disabled" Color="#FF989898"/>
        <SolidColorBrush x:Key="ControlInnerBorder_Disabled" Color="Transparent"/>
        <SolidColorBrush x:Key="ControlBackground_Disabled" Color="#FFE0E0E0"/>
        <SolidColorBrush x:Key="ControlElement_Disabled" Color="#FF8D8D8D"/>
        <SolidColorBrush x:Key="ControlOuterBorder_MouseOver" Color="#FFFFC92B"/>
        <SolidColorBrush x:Key="ControlInnerBorder_MouseOver" Color="#FFFFFFFF"/>
     
        <LinearGradientBrush x:Key="ControlBackground_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFFFBDA" Offset="0"/>
            <GradientStop Color="#FFFEEBAE" Offset="0.50"/>
            <GradientStop Color="#FFFFD25A" Offset="0.50"/>
            <GradientStop Color="#FFFFFBA3" Offset="1"/>
        </LinearGradientBrush>
     
        <SolidColorBrush x:Key="ControlElement_MouseOver" Color="#FF000000"/>
        <LinearGradientBrush x:Key="ControlOuterBorder_Pressed" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF282828"/>
            <GradientStop Color="#FF5F5F5F" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ControlInnerBorder_Pressed" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFB69A78"/>
            <GradientStop Color="#FFFFE17A" Offset="0.126"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ControlBackground_Pressed" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFFDCAB" Offset="0"/>
            <GradientStop Color="#FFFFD18F" Offset="0.5"/>
            <GradientStop Color="#FFFE9227" Offset="0.5"/>
            <GradientStop Color="#FFFFBA74" Offset="0"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ControlElement_Pressed" Color="#FF000000"/>
     
     
        <ControlTemplate x:Key="FAQRadToggleButtonControlTemplate" TargetType="telerik:RadToggleButton">
            <Grid>
               <VisualStateManager.VisualStateGroups>
                   <VisualStateGroup x:Name="FocusStates">
                       <VisualStateGroup.Transitions>
                          <VisualTransition GeneratedDuration="0:0:0.2" To="Focused"/>
                          <VisualTransition GeneratedDuration="0:0:0.2" To="Unfocused"/>
                       </VisualStateGroup.Transitions>
                       <VisualState x:Name="Unfocused"/>
                       <VisualState x:Name="Focused"/>
                   </VisualStateGroup>
               </VisualStateManager.VisualStateGroups>
               <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </Grid>
        </ControlTemplate>
     
     
     
        <ControlTemplate x:Key="ExpanderTemplate" TargetType="telerik:RadExpander">
            <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
               <VisualStateManager.VisualStateGroups>
                               <VisualStateGroup x:Name="CommonStateGroup">
                                   <VisualState x:Name="Normal"/>
                                   <VisualState x:Name="Disabled">
                                      <Storyboard>
                                          <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Stroke" Storyboard.TargetName="OuterCircle">
                                                          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlOuterBorder_Disabled}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Stroke" Storyboard.TargetName="InnerCircle">
                                                          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlInnerBorder_Disabled}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Fill" Storyboard.TargetName="OuterCircle">
                                                          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlBackground_Disabled}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Fill" Storyboard.TargetName="arrow">
                                                          <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlElement_Disabled}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <DoubleAnimation To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content"/>
                                          <DoubleAnimation To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HeaderContent"/>
                                      </Storyboard>
                                   </VisualState>
                               </VisualStateGroup>
                               <VisualStateGroup x:Name="HeaderStateGroup">
                                   <VisualState x:Name="NormalHeader"/>
                                   <VisualState x:Name="MouseOverHeader">
                                      <Storyboard>
                                          <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Stroke" Storyboard.TargetName="OuterCircle">
                                                          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlOuterBorder_MouseOver}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Stroke" Storyboard.TargetName="InnerCircle">
                                                          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlInnerBorder_MouseOver}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Fill" Storyboard.TargetName="OuterCircle">
                                                          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlBackground_MouseOver}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Fill" Storyboard.TargetName="arrow">
                                                          <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlElement_MouseOver}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                      </Storyboard>
                                   </VisualState>
                                   <VisualState x:Name="PressedHeader">
                                      <Storyboard>
                                          <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Stroke" Storyboard.TargetName="OuterCircle">
                                                          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlOuterBorder_Pressed}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Stroke" Storyboard.TargetName="InnerCircle">
                                                          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlInnerBorder_Pressed}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Fill" Storyboard.TargetName="OuterCircle">
                                                          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlBackground_Pressed}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Fill" Storyboard.TargetName="arrow">
                                                          <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlElement_Pressed}"/>
                                          </ObjectAnimationUsingKeyFrames>
                                      </Storyboard>
                                   </VisualState>
                               </VisualStateGroup>
                               <VisualStateGroup x:Name="HeaderOrientationGroup">
                                   <VisualState x:Name="HorizontalOrientation">
                                      <Storyboard>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="HeaderContentTransform">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <RotateTransform Angle="0"/>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="HeaderContentTransform">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <system:Int32>1</system:Int32>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                      </Storyboard>
                                   </VisualState>
                                   <VisualState x:Name="VerticalOrientation">
                                      <Storyboard>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="HeaderContentTransform">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <RotateTransform Angle="90"/>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="HeaderContentTransform">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <system:Int32>1</system:Int32>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                      </Storyboard>
                                   </VisualState>
                               </VisualStateGroup>
                               <VisualStateGroup x:Name="ExpandStateGroup">
                                   <VisualState x:Name="Expanded">
                                      <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.2" To="180" Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle" Storyboard.TargetName="arrow"/>
                                      </Storyboard>
                                   </VisualState>
                                   <VisualState x:Name="Collapsed">
                                      <Storyboard>
                                          <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle" Storyboard.TargetName="arrow"/>
                                      </Storyboard>
                                   </VisualState>
                               </VisualStateGroup>
                               <VisualStateGroup x:Name="ExpandDirectionStates">
                                   <VisualStateGroup.Transitions>
                                      <VisualTransition>
                                          <Storyboard>
                                              <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="Content">
                                                             <DiscreteObjectKeyFrame KeyTime="0">
                                                                             <DiscreteObjectKeyFrame.Value>
                                                                                             <system:Int32>0</system:Int32>
                                                                             </DiscreteObjectKeyFrame.Value>
                                                             </DiscreteObjectKeyFrame>
                                              </ObjectAnimationUsingKeyFrames>
                                              <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="Content">
                                                             <DiscreteObjectKeyFrame KeyTime="0">
                                                                             <DiscreteObjectKeyFrame.Value>
                                                                                             <system:Int32>0</system:Int32>
                                                                             </DiscreteObjectKeyFrame.Value>
                                                             </DiscreteObjectKeyFrame>
                                              </ObjectAnimationUsingKeyFrames>
                                              <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="HeaderButton">
                                                             <DiscreteObjectKeyFrame KeyTime="0">
                                                                             <DiscreteObjectKeyFrame.Value>
                                                                                             <system:Int32>0</system:Int32>
                                                                             </DiscreteObjectKeyFrame.Value>
                                                             </DiscreteObjectKeyFrame>
                                              </ObjectAnimationUsingKeyFrames>
                                              <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="HeaderButton">
                                                             <DiscreteObjectKeyFrame KeyTime="0">
                                                                             <DiscreteObjectKeyFrame.Value>
                                                                                             <system:Int32>0</system:Int32>
                                                                             </DiscreteObjectKeyFrame.Value>
                                                             </DiscreteObjectKeyFrame>
                                              </ObjectAnimationUsingKeyFrames>
                                              <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Width" Storyboard.TargetName="col0">
                                                             <DiscreteObjectKeyFrame KeyTime="0">
                                                                             <DiscreteObjectKeyFrame.Value>
                                                                                             <GridLength>Auto</GridLength>
                                                                             </DiscreteObjectKeyFrame.Value>
                                                             </DiscreteObjectKeyFrame>
                                              </ObjectAnimationUsingKeyFrames>
                                              <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Width" Storyboard.TargetName="col1">
                                                             <DiscreteObjectKeyFrame KeyTime="0">
                                                                             <DiscreteObjectKeyFrame.Value>
                                                                                             <GridLength>Auto</GridLength>
                                                                             </DiscreteObjectKeyFrame.Value>
                                                             </DiscreteObjectKeyFrame>
                                              </ObjectAnimationUsingKeyFrames>
                                              <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Height" Storyboard.TargetName="row0">
                                                             <DiscreteObjectKeyFrame KeyTime="0">
                                                                             <DiscreteObjectKeyFrame.Value>
                                                                                             <GridLength>Auto</GridLength>
                                                                             </DiscreteObjectKeyFrame.Value>
                                                             </DiscreteObjectKeyFrame>
                                              </ObjectAnimationUsingKeyFrames>
                                              <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Height" Storyboard.TargetName="row1">
                                                             <DiscreteObjectKeyFrame KeyTime="0">
                                                                             <DiscreteObjectKeyFrame.Value>
                                                                                            <GridLength>Auto</GridLength>
                                                                             </DiscreteObjectKeyFrame.Value>
                                                             </DiscreteObjectKeyFrame>
                                              </ObjectAnimationUsingKeyFrames>
                                          </Storyboard>
                                      </VisualTransition>
                                   </VisualStateGroup.Transitions>
                                   <VisualState x:Name="DirectionLeft">
                                      <Storyboard>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Width" Storyboard.TargetName="col0">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <GridLength>*</GridLength>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Height" Storyboard.TargetName="row0">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <GridLength>*</GridLength>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="HeaderButton">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <system:Int32>1</system:Int32>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <DoubleAnimation Duration="0:0:0" To="90" Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle" Storyboard.TargetName="arrowPanel"/>
                                      </Storyboard>
                                   </VisualState>
                                   <VisualState x:Name="DirectionRight">
                                      <Storyboard>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Width" Storyboard.TargetName="col1">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <GridLength>*</GridLength>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Height" Storyboard.TargetName="row0">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <GridLength>*</GridLength>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="Content">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <system:Int32>1</system:Int32>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <DoubleAnimation Duration="0:0:0" To="-90" Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle" Storyboard.TargetName="arrowPanel"/>
                                      </Storyboard>
                                   </VisualState>
                                   <VisualState x:Name="DirectionUp">
                                      <Storyboard>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Width" Storyboard.TargetName="col0">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <GridLength>*</GridLength>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Height" Storyboard.TargetName="row0">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <GridLength>*</GridLength>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="HeaderButton">
                                                          <DiscreteObjectKeyFrame KeyTime="0">
                                                                         <DiscreteObjectKeyFrame.Value>
                                                                                         <system:Int32>1</system:Int32>
                                                                         </DiscreteObjectKeyFrame.Value>
                                                          </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <DoubleAnimation Duration="0:0:0" To="180" Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle" Storyboard.TargetName="arrowPanel"/>
                                      </Storyboard>
                                   </VisualState>
                                   <VisualState x:Name="DirectionDown">
                                      <Storyboard>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Width" Storyboard.TargetName="col0">
                                              <DiscreteObjectKeyFrame KeyTime="0">
                                                             <DiscreteObjectKeyFrame.Value>
                                                                             <GridLength>*</GridLength>
                                                             </DiscreteObjectKeyFrame.Value>
                                              </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Height" Storyboard.TargetName="row1">
                                              <DiscreteObjectKeyFrame KeyTime="0">
                                                             <DiscreteObjectKeyFrame.Value>
                                                                             <GridLength>*</GridLength>
                                                             </DiscreteObjectKeyFrame.Value>
                                              </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                          <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="Content">
                                              <DiscreteObjectKeyFrame KeyTime="0">
                                                             <DiscreteObjectKeyFrame.Value>
                                                                             <system:Int32>1</system:Int32>
                                                             </DiscreteObjectKeyFrame.Value>
                                              </DiscreteObjectKeyFrame>
                                          </ObjectAnimationUsingKeyFrames>
                                      </Storyboard>
                                   </VisualState>
                               </VisualStateGroup>
               </VisualStateManager.VisualStateGroups>
               <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{StaticResource Expander_BorderRadius}">
                   <Grid>
                       <Grid.ColumnDefinitions>
                          <ColumnDefinition x:Name="col0" Width="Auto"/>
                          <ColumnDefinition x:Name="col1" Width="Auto"/>
                       </Grid.ColumnDefinitions>
                       <Grid.RowDefinitions>
                          <RowDefinition x:Name="row0" Height="Auto"/>
                          <RowDefinition x:Name="row1" Height="Auto"/>
                       </Grid.RowDefinitions>
                       <telerik:RadToggleButton x:Name="HeaderButton" Background="Transparent" ClickMode="{TemplateBinding ClickMode}" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalHeaderAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalHeaderAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" TabIndex="{TemplateBinding TabIndex}" Template="{StaticResource FAQRadToggleButtonControlTemplate}" VerticalAlignment="{TemplateBinding VerticalHeaderAlignment}" VerticalContentAlignment="{TemplateBinding VerticalHeaderAlignment}">
                          <Grid x:Name="HeaderPanel" Background="Transparent">
                              <Grid.ColumnDefinitions>
                                  <ColumnDefinition Width="Auto"/>
                                  <ColumnDefinition Width="*"/>
                              </Grid.ColumnDefinitions>
                              <Grid.RowDefinitions>
                                  <RowDefinition Height="Auto"/>
                                  <RowDefinition Height="*"/>
                              </Grid.RowDefinitions>
                              <Grid Grid.Column="0" Grid.Row="0">
                                  <Ellipse x:Name="OuterCircle" Fill="{StaticResource ControlBackground_Normal}" HorizontalAlignment="Center" Height="20" Stroke="{StaticResource ControlOuterBorder_Normal}" VerticalAlignment="Center" Width="20"/>
                                  <Ellipse x:Name="InnerCircle" HorizontalAlignment="Center" Height="18" Stroke="{StaticResource ControlInnerBorder_Normal}" VerticalAlignment="Center" Width="18"/>
                                  <Grid x:Name="arrowPanel" RenderTransformOrigin=".5 .5">
                                     <Grid.RenderTransform>
                                         <RotateTransform/>
                                      </Grid.RenderTransform>
                                     <Path x:Name="arrow" Data="M0,0 L0.67,0 4,2.67 7.25,0 8,0 8,0.67 4,4 0,0.75 z" Fill="{StaticResource ControlElement_Normal}" Height="4" RenderTransformOrigin="0.5,0.5" Stretch="None" Width="8">
                                         <Path.RenderTransform>
                                                         <RotateTransform Angle="0"/>
                                         </Path.RenderTransform>
                                     </Path>
                                  </Grid>
                              </Grid>
                              <telerik:LayoutTransformControl x:Name="HeaderContentTransform" Grid.Column="0" Grid.Row="0" RenderTransformOrigin=".5 .5">
                                              <ContentPresenter x:Name="HeaderContent" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Grid.Column="1" HorizontalAlignment="Stretch" Margin="5 0" VerticalAlignment="Stretch"/>
                              </telerik:LayoutTransformControl>
                          </Grid>
                       </telerik:RadToggleButton>
                       <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                   </Grid>
               </Border>
            </Grid>
        </ControlTemplate>
     
     
     
        <Style x:Key="FAQRadExpanderStyle" TargetType="telerik:RadExpander">
                    <Setter Property="IsTabStop" Value="false"/>
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="Background" Value="{StaticResource Expander_Background}"/>
                    <Setter Property="BorderBrush" Value="{StaticResource Expander_BorderBrush}"/>
                    <Setter Property="BorderThickness" Value="{StaticResource Expander_BorderThickness}"/>
                    <Setter Property="Padding" Value="2"/>
                    <Setter Property="Template" Value="{StaticResource ExpanderTemplate}"/>
                    <Setter Property="telerik:AnimationManager.AnimationSelector">
                       <Setter.Value>
                           <telerik:AnimationSelector>
                                          <telerik:ExpanderExpandCollapseAnimation AnimationName="Expand" Direction="In" TargetElementName="Content"/>
                                           <telerik:ExpanderExpandCollapseAnimation AnimationName="Collapse" Direction="Out" TargetElementName="Content"/>
                           </telerik:AnimationSelector>
                       </Setter.Value>
                    </Setter>
        </Style>
     
     
     
          <DataTemplate x:Key="FAQListBoxItems">
            <toolkit:WrapPanel>
                <telerik:RadExpander IsExpanded="False" VerticalContentAlignment="Top" telerik:AnimationManager.IsAnimationEnabled="{Binding ElementName=AnimationEnableCheckBox, Path=IsChecked}"
                Style="{StaticResource FAQRadExpanderStyle}">
                <telerik:RadExpander.Header>
                   <ContentPresenter Margin="5" Content="{Binding Title}"/>
                </telerik:RadExpander.Header>
                <telerik:RadExpander.Content>
                    <ContentPresenter Margin="5" Content="{Binding Answer}"/>
                </telerik:RadExpander.Content>
            </telerik:RadExpander>
            </toolkit:WrapPanel>
        </DataTemplate>
     
     
     
          <Style x:Key="FAQListBoxItemStyle" TargetType="ListBoxItem">
            <Setter Property="Padding" Value="3"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="TabNavigation" Value="Local"/>
            <Setter Property="Template">
               <Setter.Value>
                   <ControlTemplate TargetType="ListBoxItem">
                       <Grid Background="{TemplateBinding Background}">
                          <VisualStateManager.VisualStateGroups>
                              <VisualStateGroup x:Name="CommonStates">
                                  <VisualState x:Name="Normal"/>
                                  <VisualState x:Name="MouseOver">
                                                 <Storyboard>
                                                                 <DoubleAnimation Duration="0" To=".35" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="fillColor"/>
                                                 </Storyboard>
                                  </VisualState>
                                  <VisualState x:Name="Disabled">
                                                 <Storyboard>
                                                                 <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="contentPresenter"/>
                                                 </Storyboard>
                                  </VisualState>
                              </VisualStateGroup>
                              <VisualStateGroup x:Name="SelectionStates">
                                  <VisualState x:Name="Unselected"/>
                                  <VisualState x:Name="Selected">
                                                 <Storyboard>
                                                                 <DoubleAnimation Duration="0" To=".75" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="fillColor2"/>
                                                                 <ColorAnimation Duration="0" To="{StaticResource TransparentDarkDarkColor}" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="fillColor2" d:IsOptimized="True"/>
                                                 </Storyboard>
                                  </VisualState>
                                  <VisualState x:Name="SelectedUnfocused"/>
                              </VisualStateGroup>
                              <VisualStateGroup x:Name="FocusStates">
                                  <VisualState x:Name="Focused"/>
                                 <VisualState x:Name="Unfocused"/>
                              </VisualStateGroup>
                              <VisualStateGroup x:Name="LayoutStates">
                                  <VisualState x:Name="AfterLoaded"/>
                                  <VisualState x:Name="BeforeLoaded"/>
                                  <VisualState x:Name="BeforeUnloaded"/>
                              </VisualStateGroup>
                          </VisualStateManager.VisualStateGroups>
                          <Rectangle x:Name="fillColor" Fill="#FFBADDE9" IsHitTestVisible="False" Opacity="0" RadiusY="1" RadiusX="1"/>
                          <Rectangle x:Name="fillColor2" Fill="#FFBADDE9" IsHitTestVisible="False" Opacity="0" RadiusY="1" RadiusX="1"/>
                          <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                       </Grid>
                   </ControlTemplate>
               </Setter.Value>
            </Setter>
          </Style>

    Do you know where it could come from?

    Thanks in advance.

  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 04 Mar 2013 Link to this post

    Hello Adrien,

    I am not sure that I can understand your scenario from the snippet you sent. Can you please try to isolate the issue in a separate (runnable) project and send it to us? Then we will be able to better understand and further investigate your issue. Thank you for your cooperation.

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top