Sto*_*dza 1 c# wpf animated-gif
我从codeplex下载了WPFAnimatedGiff.dll.这就是问题所在:我正在尝试在标签项中实现giff.giff实际上是一个循环进度条,所以我试图模拟标签项的加载过程,类似于谷歌Chrome进度条.我插入了图像,它在设计器中可见,但在运行我的应用程序时它不会显示.此外,当我在网格中的其他位置插入图像时,它确实显示出来.这是代码:
<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>
Run Code Online (Sandbox Code Playgroud)
尝试谷歌的解决方案,但找不到任何有用的东西,所以我希望有人可以帮助我. 编辑:只是提到我插入这样的图像时:
<Image Source="Images/CircleBar.gif" />
Run Code Online (Sandbox Code Playgroud)
它在应用程序运行时显示,但没有旋转/动画.
有两种解决方案