如何在WPF弹出窗口中显示Gif?

时间:2018-10-25 13:10:29

标签: c# wpf animated-gif

<Popup 
    Name="loadingAnimation"
    PlacementTarget="{Binding ElementName=m_mainWindow}"
    Placement="Center"
    StaysOpen="True"
    IsOpen="True"
    Height="200"
    Width="200">
    <MediaElement 
        Height="200"
        Width="200"
        Margin="-100,-72,0,0"
        HorizontalAlignment="Left"
        VerticalAlignment="Top"
        Source="/Images/Loading.gif" 
        LoadedBehavior="Play"/>
</Popup>

代码剂量以黑色显示弹出区域,但不播放gif。如果设置AllowsTransparency =“ True”,我什么也看不到。如何在弹出窗口中显示gif?

0 个答案:

没有答案