我從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文件夾內 –