ricaun.Revit.UI.Busy
package provides a static control to monitor the busy state of Revit UI using the Idling
event.
This project was generated by the ricaun.AppLoader Revit plugin.
RevitBusyControl
is a static control to monitor the busy state of Revit UI using the Idling
event, this class need to be initialized.
Static initialization of the ricaun.Revit.UI.Busy
control.
UIControlledApplication application;
RevitBusyControl.Initialize(application);
The RevitBusyService
class is available in the static Control
property.
RevitBusyService revitBusyService = RevitBusyControl.Control;
To check if Revit is busy, use the IsRevitBusy
property.
bool isRevitBuzy = RevitBusyControl.Control.IsRevitBusy;
To use binding with the static RevitBusyControl
is needed to reference the assembly ricaun.Revit.UI.Busy
or using the http://schemas.revit.busy.com/2024/xaml/presentation
xmlns.
xmlns:busy="http://schemas.revit.busy.com/2024/xaml/presentation"
The IsRevitBusy
property can be used in the binding using the static Control
with the RevitBusyService
.
{Binding IsRevitBusy, Source={x:Static busy:RevitBusyControl.Control}}
The RevitBusyService
class provides a service to manage the busy state of Revit using the Idling
event.
UIControlledApplication application;
RevitBusyService revitBusyService = new RevitBusyService(application);
The RevitBusyService
need to be disposed to clear the Idling
event.
revitBusyService.Dispose();
The IsRevitBusy
property can be used to check if Revit is busy.
bool isRevitBuzy = revitBusyService.IsRevitBusy;
The INotifyPropertyChanged
is available in the RevitBusyService
class.
revitBusyService.PropertyChanged += (sender, e) =>
{
if (e.PropertyName == nameof(revitBusyService.IsRevitBusy))
{
// Do something
}
};
The SetInterval
method can be used to set the interval between checks; by default, the value is 1000 milliseconds.
revitBusyService.SetInterval(1000);
This project is licensed under the MIT License.
Do you like this project? Please star this project on GitHub!