我从codeplex下载了WPFAnimatedGiff.dll。这里是问题: 我试图实现标签项中的吉夫。 giff实际上是一个循环进度条,所以我试图模拟类似谷歌浏览器进度条的标签项目的加载过程。我插入了图像,并且它在设计器中可见,但是当我运行我的应用程序时它不显示。另外当我在网格中的其他地方插入图像时,它确实显示出来。 下面是代码:当应用程序运行时,动画gif不起作用
<Window x:Class="WPFHotel.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WPFHotel"
xmlns:data="clr-namespace:WPFHotel.Database"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:gif="http://wpfanimatedgif.codeplex.com" />
<TabItem Tag="PB1" Header="Rezervacije" Name="Reservations" BorderBrush="Black" FontFamily="Times New Roman" FontWeight="Bold" FontSize="14">
<TabItem.HeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Rezervacije" Margin="5,2,0,0" />
<Image gif:ImageBehavior.AnimatedSource="Images/468.gif" Stretch="None" />
</StackPanel>
</DataTemplate>
</TabItem.HeaderTemplate>
</TabItem>
尝试过谷歌的解决方案,但无法找到任何有用的,所以我希望有一个能帮助我在这里。 编辑:只是提一提,当我插入这样的形象:
<Image Source="Images/CircleBar.gif" />
它显示应用程序运行时,但没有旋转/动画。
在属性锅什么是'建立action'图像è?将其设置为“资源” –
它设置为资源。 – Stojdza
试过你的代码,并为我工作得很好。确保你的图像名称是正确的,它位于Images文件夹内 –