2016-07-21 3 views
2

어떻게하면 THIS 애니메이션 유형을 얻을 수 있습니까? 나는 WPF에 대해 매우 익숙하다. WPF에서 DoubleAnimation으로 시도했지만 목표를 달성하지 못했습니다. 내가 점수가 23WPF 텍스트 블록 애니메이션

덕분에 17에서 업데이트 될 때 비디오에 일어나고 같은 점수를 업데이트 할 때

애니메이션이 발생한다!

+0

게시 한 링크가 보이지 않습니다.이 웹 사이트는 과부하가 걸리고 있습니다 :-) 나중에 다시 시도해 보겠습니다! –

+1

나는 애니메이션을 본다. 여기에 XAML을 작성하는 것은 어렵습니다. 기본적으로 두 개의 DoubleAnimation이 필요합니다. 하나는 TextBlock의 불투명도를 제어하고 다른 하나는 변환을 제어하는 ​​것입니다. –

+0

감사합니다! 이고르 다미 아니. 그러나 솔직히 나는 이것을 쓰는 방법을 모른다. 아직도 시도 할 것이다. 도움이 더 필요하면 PLZ 도와주세요. 참고로 VS 2015을 사용하고 있습니다. – waghekapil

답변

2

시도해보십시오.

<Window x:Class="WpfApplication1.AnimWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:local="clr-namespace:WpfApplication1" 
    mc:Ignorable="d" 
    Title="AnimWindow" Height="300" Width="300"> 

<Window.Triggers> 
    <EventTrigger RoutedEvent="Window.Loaded"> 
     <BeginStoryboard> 
      <Storyboard> 
       <DoubleAnimation Storyboard.TargetName="PointsNew" To="1.0" Storyboard.TargetProperty="Opacity" Duration="0:0:0.5" /> 
       <DoubleAnimation Storyboard.TargetName="PointsOld" To="0.0" Storyboard.TargetProperty="Opacity" Duration="0:0:0.5" /> 
       <ThicknessAnimation Storyboard.TargetName="PointsNew" From="0 -32 0 0" To="0 0 0 0" Storyboard.TargetProperty="Margin" Duration="0:0:0.5" /> 
       <ThicknessAnimation Storyboard.TargetName="PointsOld" To="0 32 0 0" Storyboard.TargetProperty="Margin" Duration="0:0:0.5" /> 
      </Storyboard> 
     </BeginStoryboard> 
    </EventTrigger> 
</Window.Triggers> 

<Grid> 
    <Border HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0.0" x:Name="PointsNew"> 
     <TextBlock Text="23" FontSize="96" FontWeight="Bold" /> 
    </Border> 
    <Border HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="1.0" x:Name="PointsOld"> 
     <TextBlock Text="17" FontSize="96" FontWeight="Bold" /> 
    </Border> 
</Grid></Window> 

여백, 기간 등을 사용해보십시오! :-)

+0

감사합니다. 나 해보자. – waghekapil

+0

오, 굉장해! 그것은 내가 찾고 있었던 바로 그 것이다. 정말 고맙습니다. 고마워요, 고마워요, 고마워요. – waghekapil