-
[WPF]LoadingSpinnerC#/WPF 2023. 6. 13. 09:39
Using GIF image as animation:
You can also use a GIF image as a loading indicator in your project. The WPF does not support animating the GIF image as default, if you try to use it just like JPG or PNG image, it will not animate. Fortunately, there is a NuGet package called WpfAnimatedGif which can animate the GIF images. Let’s see how to make use of it.
First of all, install WpfAnimatedGif, for this, go to Tools > Nuget Package Manager > Package Manager Console, then type Install-Package WpfAnimatedGif, then in MainWindow.xaml file, add xmlns:gif=”http://wpfanimatedgif.codeplex.com” as XML namespace. after that, add the GIF image in your project, remove progress bar control and finally, create an image control as follows:
<Image Name="imgCircle" Visibility="Collapsed" Width="100" Height="100" gif:ImageBehavior.AnimatedSource="/circle.gif" />The complete MainWindow.xaml file will look like this:
<Window x:Class="LoadingAnimation.MainWindow"xmlns:local="clr-namespace:LoadingAnimation"mc:Ignorable="d"Title="MainWindow" Height="300" Width="300"><Grid><Image Name="imgCircle" Visibility="Collapsed" Width="100" Height="100" gif:ImageBehavior.AnimatedSource="/circle.gif" /><Button Name="PerformTask" Content="Execute job" Click="PerformTask_Click" Margin="110,50,0,0" Width="80" Height="20" HorizontalAlignment="Left" VerticalAlignment="Top"/></Grid></Window>Now run the project, the output of the project will look like this:
https://dottutorials.net/wpf-loading-animation-in-net-core-3/
Creating Loading Animation for long Tasks in .Net Core WPF
Introduction Often we need to perform some time-consuming tasks in our code. A good app should use a…
dottutorials.net
https://github.com/shehryarkn/Loading-Animation-DotNet-Core-3-WPF
GitHub - shehryarkn/Loading-Animation-DotNet-Core-3-WPF
Contribute to shehryarkn/Loading-Animation-DotNet-Core-3-WPF development by creating an account on GitHub.
github.com
https://it-delinquent.medium.com/wpf-spinning-image-loading-wheel-62185a4317c
WPF Spinning Image — Loading Wheel
This is just a quick post for something that caused me quite a bit of hassle. How to spin an image in WPF. This is useful for creating…
it-delinquent.medium.com
https://stackoverflow.com/questions/6359848/wpf-loading-spinner
WPF loading spinner
The goal is to display the information that the application is working. So I'm looking for an intelligent implementation sample of a loading spinner using WPF / MVVM.
stackoverflow.com
https://www.youtube.com/watch?v=wJsGRM8g6_4
728x90'C# > WPF' 카테고리의 다른 글
[WPF] 프로세스간 메시지 전달 (0) 2023.06.20 [WPF] URL (0) 2023.06.13 [WPF] ShellExecute (0) 2023.06.09 [WPF] Platform (0) 2023.06.07 [WPF] PostBuildEvent (0) 2023.06.01 댓글