Donate

WPF Busy Overlay Or Busy Indicator Example In C#

Greetings all!

I've been doing some research on how to add an overlay feature similar to an Ajax busy modal to one of my WPF projects. A simple approach led me to this topic WPF: Simple "Busy" Overlay. Since I'm using the traditional MVVM and not Simon Cropp’s Notify Property Weaver, I made this work by creating a WPF project using Visual Studio 2017 (installed in my workstation) and then copied the codes specifically BoolToVisibilityConverter.cs, BusyViewModel.cs, DelegateCommand.cs and MainWindow.xaml from his example at BitBucket. I also changed the IsBusy property to implement the OnPropertyChanged event
private bool _IsBusy;
public bool IsBusy
{
 get { return _IsBusy; }
 set
 {
  _IsBusy = value;
  OnPropertyChanged("IsBusy");
 }
}
and added the implementation of that event.
protected void OnPropertyChanged(string propertyName)
{
 if (PropertyChanged != null)
  PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
After the changes have been reflected, the overlay shows after clicking the Do Something link. WPF Busy Overlay Or Busy Indicator Example In C#
Source Code At Github.

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

Bootstrap Modal In ASP.NET MVC With CRUD Operations