viewmodel 속성의 값에 따라 윈도우의 왼쪽 또는 오른쪽에 나타날 수있는 컨트롤이 있습니다 (버튼의 결과가 UI).HorizontalAlignment가 변할 때 페이드 인하는 방법
<Trigger Property="HorizontalAlignment" Value="Left">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="0.8" Duration="0:0:0.2"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
<Trigger Property="HorizontalAlignment" Value="Right">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="0.8" Duration="0:0:0.2"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
는 몇 가지 이상한 생산하지만 -이 :
이<DataTrigger Binding="{Binding ShowOnLeft}" Value="True">
<Setter Property="HorizontalAlignment" Value="Left"/>
</DataTrigger>
<DataTrigger Binding="{Binding ShowOnLeft}" Value="False">
<Setter Property="HorizontalAlignment" Value="Right"/>
</DataTrigger>
지금은 위치 변경을 때의 제어 페이드를 만들고 싶어, 그래서 이러한 트리거를 추가
이 :이 위치를 달성하기 위해 DataTriggers을 사용하고 있습니다 결과. 페이드는 HorizontalAlignment가 처음으로 "왼쪽"으로 변경되지만 이후 시도에서는 변경되지 않습니다. 그러나 HorizontalAlignment가 "Right"로 바뀔 때마다 페이드는 행복하게 작동합니다. 그것은 부분적으로 순서를 트리거하는 것 같다 - 만약 내가 두 개의 트리거를 바꿔 가면 반전이 일어난다. (페이드는 처음으로 HorizontalAlignment를 "Right"로 설정했을 때만 작동하지만 "Left"는 매번 작동한다).
내가 뭘 잘못하고 있니?
그 트릭을 했어! 많은 감사합니다. –