Lorsque j'ai démarré mon projet Silverlight 5, j'ai mis une image avec une animation (j'ai fait dans Blend) sur mon menu principal, cela a très bien fonctionné. Puis je suis allé de l'avant dans mon projet et je n'ai pas réalisé exactement à quel moment j'ai arrêté de voir mon image et mon animation.Je ne vois pas une image dans mon projet Silverlight 5
j'ai fait un test sur mon projet, la création d'un nouveau contrôle utilisateur, qui n'a que l'image et l'animation, et cela ne fonctionne pas, je fait un nouveau projet et mis l'image et l'animation sur la page principale, et cela fonctionne!
Est-ce que quelqu'un a une idée de ce qui se passe dans mon projet original qui m'empêche de voir l'image et l'animation?
Merci beaucoup
Par exemple, sur mon SilverlightControl1.xaml:
`
<UserControl.Resources>
<Storyboard x:Name="Mtto2Animacion" RepeatBehavior="Forever" AutoReverse="False">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="image2">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="55.77"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-0.217"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<ImageBrush x:Key="BackgroundMTTO" ImageSource="Imagenes/MTTOBackground.png" Stretch="UniformToFill"/>
<ImageBrush x:Key="IMGBannerPradera" ImageSource="Imagenes/BannerPradera.png" Stretch="UniformToFill"/>
</UserControl.Resources>
<Grid x:Name="LayoutRoot">
<Image x:Name="image2" Margin="5" Source="Imagenes/MTTO2.png" Loaded="image2_Loaded">
<Image.RenderTransform>
<CompositeTransform/>
</Image.RenderTransform>
</Image>
</Grid>
`
Et mes SilverlightControl1.xaml.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace MTTO
{
public partial class SilverlightControl1 : UserControl
{
public SilverlightControl1()
{
InitializeComponent();
}
private void image2_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
Mtto2Animacion.Begin();
}
}
}
Ceci est mon image (MTTO2.png)
Vous aurez probablement besoin de partager du code pour nous de voir. Cela peut être quelque chose de simple comme un chemin d'image, ou ne pas déclencher votre storyboard, ou l'action de construction de l'image, ou un certain nombre de choses. Sans être capable de le recréer, même si c'est difficile à deviner par la description que vous avez donnée. –
thnks Chris W.: – Cyndy
J'ai ajouté un exemple à mon article – Cyndy