2014-06-20 19 views
5

Windows Silverlight 8 telefonunda XAML Sayfası'nda düğme içeriği üzerinde animasyon oluşturdum. Ama projemi Windows RT'ye taşıdığımda 8.1 RT .. düğmesinin animasyonu şu şekilde çalışmıyor: Silverlight telefon projesinde çalışıyordu. Ben Silverlight telefonda 8'de uygulamış kodunun altına ekledik Interaction.Behaviors, düğme içeriği için çalışmıyor

..

kısım referans pencereler telefon 8.1 için .. Eklediğim davranış sdk çalışmıyor

Interaction.Behaviors kodu ...

Ben de etkileşim için kullanan üçün altına ekledik

..

 xmlns:i="using:Microsoft.Xaml.Interactivity" 
     xmlns:ic="using:Microsoft.Xaml.Interactions.Core" 
     xmlns:im="using:Microsoft.Xaml.Interactions.Media" 

XAML

<Button x:Name="MenuButton" 
       Style="{StaticResource PageNumberButtonStyle}" 
       Height="180" 
       Margin="10" 
       Width="240" 
       Click="MenuButtonClick" 
       Content="{Binding CurrentPage.Number}" 
       FontFamily="ms-appx:///Fonts/sesamewkshpregular.ttf#SesameWkshp Rg" 
       HorizontalAlignment="Left" 
       RenderTransformOrigin="0.5,0.5" 
       VerticalAlignment="Bottom"> 
      <Button.RenderTransform> 
       <CompositeTransform x:Name="MenuButtonScale" 
            ScaleX="0" 
            ScaleY="0" /> 
      </Button.RenderTransform> 
     </Button> 



<Page.Resources> 
    <ResourceDictionary> 
     <!-- PageNumberButtonStyle --> 
     <Style x:Key="PageNumberButtonStyle" 
       TargetType="Button"> 
      <Setter Property="Template"> 
       <Setter.Value> 
        <ControlTemplate TargetType="Button"> 
         <Grid> 
          <VisualStateManager.VisualStateGroups> 
           <VisualStateGroup x:Name="FocusStates"> 
            <VisualState x:Name="Unfocused" /> 
            <VisualState x:Name="Focused" /> 
           </VisualStateGroup> 
           <VisualStateGroup x:Name="PageNumberStates"> 
            <VisualState x:Name="BindingChanged"> 
             <Storyboard> 
              <DoubleAnimation From="1" 
                  To="0" 
                  Storyboard.TargetProperty="(UIElement.Opacity)" 
                  Storyboard.TargetName="contentPresenter" /> 
             </Storyboard> 
            </VisualState> 
           </VisualStateGroup> 
          </VisualStateManager.VisualStateGroups> 
          <Grid.Background> 
           <ImageBrush Stretch="None" ImageSource="/Resources/Assets/Book-Solid.png" /> 
          </Grid.Background> 

          <ContentPresenter x:Name="contentPresenter" 
               HorizontalAlignment="Center" 
               VerticalAlignment="Center" 
               Margin="0,20,0,0" 
               RenderTransformOrigin="0.5,0.5"> 
           <ContentPresenter.RenderTransform> 
            <CompositeTransform x:Name="contentTransform" 
                 ScaleX="0.5" 
                 ScaleY="0.5" /> 
           </ContentPresenter.RenderTransform> 
          </ContentPresenter> 

          <i:Interaction.Behaviors> 
           <ic:DataTriggerBehavior Binding="{Binding CurrentPage.Number}"> 
            <im:ControlStoryboardAction ControlStoryboardOption="Play"> 
             <im:ControlStoryboardAction.Storyboard> 
              <Storyboard> 
               <DoubleAnimation From="0" 
                   To="1" 
                   Duration="0:0:1" 
                   Storyboard.TargetProperty="ScaleX" 
                   Storyboard.TargetName="contentTransform"> 
                <DoubleAnimation.EasingFunction> 
                 <ElasticEase EasingMode="EaseOut" 
                    Oscillations="2" 
                    Springiness="5" /> 
                </DoubleAnimation.EasingFunction> 
               </DoubleAnimation> 
               <DoubleAnimation From="0" 
                   To="1" 
                   Duration="0:0:1" 
                   Storyboard.TargetProperty="ScaleY" 
                   Storyboard.TargetName="contentTransform"> 
                <DoubleAnimation.EasingFunction> 
                 <ElasticEase EasingMode="EaseOut" 
                    Oscillations="2" 
                    Springiness="5" /> 
                </DoubleAnimation.EasingFunction> 
               </DoubleAnimation> 
              </Storyboard> 
             </im:ControlStoryboardAction.Storyboard> 
            </im:ControlStoryboardAction> 
           </ic:DataTriggerBehavior> 
          </i:Interaction.Behaviors> 
         </Grid> 
        </ControlTemplate> 
       </Setter.Value> 
      </Setter> 
      <Setter Property="FontSize" Value="150" /> 

     </Style> 
belirli bir Değerine karşılaştırma için bir koşul ihtiyacı olduğu DataTriggerBehaviour bir ComparisonConditionType ve Value özelliklerini ekleyerek

Please, guide me here for this problem.. 
+0

'DataTriggerBehavior'den' Value' eksik misiniz? Silverlight veya WPF'de çalışıyor mu? Belki de eğer sorun buysa davranışı kullanmadan yapabilirsiniz. – pushpraj

cevap

0

deneyin.

+0

Lütfen, verilen cevabınız ile sonuna kadar kontrol edin. ve bana bildirin .. değil üzerinde çalışıyor? Neden çalışmıyor ... – sikender