moh3ngolshani / busyindicator Goto Github PK
View Code? Open in Web Editor NEWBusy Indicator for WPF
License: MIT License
Busy Indicator for WPF
License: MIT License
I am using this package in my WPF app with target .NET5. Here, only few indicators such as Swirl and Ellipse work and other indicators do not show up. Also, I can't change the color of the working indicators too. Is it due to my target framework or something else? Hoping a fix soon.
Hello,
your library is really cool.
Is there a way to change the size of the indicators?
Thank you.
please change busyindicator:BusyMask to busyIndicator:BusyMask
<busyindicator:BusyMask x:Name="BusyIndicator" IsBusy="False" IndicatorType="Dashes" BusyContent="Please wait..." >
<... MAIN VIEW GOES HERE... >
</busyIndicator:BusyMask>
Hello,
your library is really cool.
Could you tell me how to set the focus to a control when IsBusy = false?
Is there a way to have a FocusAfterBusy property like the one in xceed toolkit?
Thank you.
I try to do binding but not working. Did I miss anything?
<busyIndicator:BusyMask x:Name="BusyIndicator" IsBusy="{Binding IsBusy}" BusyContent="Please wait..." IndicatorType="Dashes">
`public partial class MainWindow : Window, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
private bool _isBusy;
public bool IsBusy
{
get => _isBusy;
set { _isBusy = value; OnPropertyChanged(); }
}
public MainWindow()
{
InitializeComponent();
IndicatorComboBox.SelectedIndex = 0;
Stop();
DataContext = this;
}
private async void Button_Click(object sender, RoutedEventArgs e)
{
if (!double.TryParse(MyTextBox.Text, out double duration))
{
duration = 10;
}
IsBusy = true;
await Task.Delay(System.TimeSpan.FromSeconds(duration));
IsBusy = false;
}
}`
Is there anyway to get rounded corners for the BusyContent border?
If binding IsBusy with boolean property of MVVM and set this property to true, it does not activate IsBusy.
This is due to the line 'IsBusy = IsBusyAtStartup;' that breaks the binding.
public override void OnApplyTemplate()
{
IsBusy = IsBusyAtStartup;
ChangeVisualState(IsBusyAtStartup);
}
This could be solved by:
public override void OnApplyTemplate()
{
if (IsBusyAtStartup) IsBusy = true;
ChangeVisualState(IsBusyAtStartup);
}
Indicator type "Swirl" is broken. The circle is now completely blue with no visible animation.
It seems like it was introduced with the changes from 48bf107. That commit introduced IndicatorForeground
as a resource and replaced the LinearGradientBrush
es from the Swirl.xaml
template.
I set indicatorbackground, but it has no effect
I found the following issue when testing my application: Even though nothing was happening in the app, the CPU and GPU usage were constantly around 1-5%. The source of the issue turned out to be the BusyIndicator
. Although its Visibility
is Collapsed
at that time, the animation is still running in the background - since it is only started in OnApplyTemplate()
, but it is never stopped. This leads to the problem that the render thread keeps updating the region where the BusyIndicator
is located. I checked this with the WPF Performance Suite which showed that there were around 250 "dirty rects" per second. All of them were caused by the BusyIndicator
and made the render thread "think" it needs to re-render that area of the window.
I created a minimal repro project to make sure the issue is not related to my application. The issue could be reproduced by simply adding that content to an empty WPF main window:
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<CheckBox x:Name="chkIsBusy" Content="Is Busy" HorizontalAlignment="Center" />
<busyIndicator:BusyMask
IsBusy="{Binding IsChecked, ElementName=chkIsBusy}"
IndicatorType="Cupertino"
Content="Some Content..."
BusyContent="I am busy..."
HorizontalAlignment="Center"
MinHeight="100" />
</StackPanel>
I think a simple solution for this issue is to stop the animation(s) when the BusyIndicator
gets hidden and to restart it when it becomes visible again.
i couldn't add the Stop button ,
would you please let me know how to add the stop button?
Model value:
public bool isMyBusy = false;
public bool IsMyBusy
{
get
{
return isMyBusy;
}
set
{
if (isMyBusy == value)
{
return;
}
isMyBusy = value;
RaisePropertyChanged("IsMyBusy");
}
}
view binding:
<xctk:BusyMask x:Name="BusyIndicator"
IsBusy="{Binding IsMyBusy,Mode=TwoWay}" BusyContent="Please wait......" FocusAfterBusy="{Binding ElementName=MyGrid}"
BusyContentMargin="10" IndicatorType="Dashes" IsBusyAtStartup="False"></xctk:BusyMask>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.