私はExpression Blend 4 + Visual Studio 2010 Proを使用してWPFアプリケーションを作成しています。VS2010のInvalidOperationException
完全に機能するBlend 4のみを使用してCheckBoxに基づいてコントロールスタイルを作成しましたか(またはテンプレートを使用する必要がありますか)。私はVS2010に行くしかしときに私は、次の "エラー" を得る:。。
'[不明]' プロパティ「のパス に へのDependencyObjectを指していない(0)(1)[0](2 ) '。
私がアプリケーションを実行しても、完全に正常に動作します。今、私はがこのエラーを解決するためにを必要としませんが、とにかくそれを取り除きたいと思います。あなたがチェックし、チェックなしの状態で、両方の絵コンテにエラーの参照を見ることができるように
<Style x:Key="IRSensorCheckBoxStyle" TargetType="{x:Type CheckBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Grid Cursor="Hand">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="ellipse">
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="ellipse">
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="2"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="ellipse">
<EasingDoubleKeyFrame KeyTime="0" Value="2"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="ellipse">
<EasingColorKeyFrame KeyTime="0:0:0.3" Value="Red"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="ellipse">
<EasingColorKeyFrame KeyTime="0:0:0.2" Value="#00FF0000"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Ellipse x:Name="ellipse" Stroke="Yellow" StrokeThickness="0">
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="Red"/>
<GradientStop Offset="1" Color="#00FF0000"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
:ここ
スタイルのXAMLコードです。しかし、私はターゲットが "ellipse"であるため、そのプロパティがDependencyObjectを指していないというエラーに同意しません。 TargetプロパティがShapeのFillを指していますが、これは右端にあります(Ellipse's Fill)。 GradientBrushのGradientStops [0]には、RadialGradientBrushに2つのGradientStopsがあります。最後にGradientStopのColorプロパティに移動します。これもそこにあります。誰かに提案がありますか?
ありがとうございます。あなたが直接そのColorプロパティを参照することができるのGradientStopあなたに名前を与える場合
: