我需要您的帮助,因为我在 Silverlight 应用程序中收到以下消息:
{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 )}
我正在使用一个列表框,我已将项目更改为 Telerik RadExpanders。
<ListBox ItemsSource="{Binding FaqItems, ElementName=Root}" ItemTemplate="{StaticResource FAQListBoxItems}" ItemContainerStyle="{StaticResource FAQListBoxItemStyle}" Width="650" ScrollViewer.HorizontalScrollBarVisibility="Disabled"/>
<ControlTemplate x:Key="ExpanderTemplate" TargetType="telerik:RadExpander">
<Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
[...]Animation part[...]
<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>
你知道它可能来自哪里吗?提前致谢。