アイテムがリストボックスに追加されたときに最初のアニメーションを追加しようとしています。Silverlightレイアウトの状態が前にロードされました - >後の遷移がうまく動作しない
<ListBox Grid.Row="1" ItemsSource="{Binding Days}" x:Name="Days"
HorizontalAlignment="Stretch"
SelectedItem="{Binding CurrentDay, Mode=TwoWay}"
ItemTemplate="{StaticResource TimeRecordByDayItemTemplate}"
ItemsPanel="{StaticResource ByMonthDaysItemsPanelTemplate}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemContainerStyle="{StaticResource DayListBoxItemStyle}" />
私はちょうど私がちょうど次られたにもかかわらず、任意のアニメーションを得ることはありません。私のリストボックスには、次のようになります
<VisualStateGroup x:Name="LayoutStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="AfterLoaded"/>
<VisualState x:Name="BeforeLoaded">
<Storyboard>
<DoubleAnimation Duration="0" To="35" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
</Storyboard>
</VisualState>
<VisualState x:Name="BeforeUnloaded">
<Storyboard>
<DoubleAnimation Duration="0" To="0.85" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
<DoubleAnimation Duration="0" To="0.85" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
:私はitemcontainerstyle内部でブレンドによって生成されたLayoutstatesを、使用しています。このため channel9チュートリアルをステップバイステップで!
これは私の州のマネージャーの最初の問題です。私はdatatriggersの問題に遭遇しています。特定の条件が満たされていて、動作していてもいない状態がありますが、 ! また、すべてのアニメーションはExpression Blendプレビューで機能します。
私は問題を作ることができない、私は...(channel 9でここを見て)自分の環境で作業していない最も簡単なサンプルからコピーSilverlightとアニメーションでそう頻繁に
感謝のためにこれを持っていました手伝う!
私が持っている問題は、datacontextを設定する前に、viewmodelsコンストラクタで自分のコレクションを作成することです。レイアウトの変更はリストの操作だけを認識し、リストのプロパティ自体の変更は認識しないようです。詳細についてはこちらをご覧ください:http://forums.silverlight.net/p/235377/581822.aspx/1?p=True&t=634480406085452885 –