GithubHelp home page GithubHelp logo

moh3ngolshani / busyindicator Goto Github PK

View Code? Open in Web Editor NEW
112.0 7.0 20.0 25.51 MB

Busy Indicator for WPF

License: MIT License

C# 100.00%
busyindicator wpf loader spinner loading indicator loading-indicator loading-spinner csharp

busyindicator's People

Contributors

am-kh avatar d-diyare avatar derekgooding avatar mcdonnelldouglas avatar moh3ngolshani avatar mvpcom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

busyindicator's Issues

Indicators Not Working

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.

ReadME issue

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>

How to set focus to a control after is busy

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.

Bind IsBusy not working

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;
}

}`

Rounded Corners

Is there anyway to get rounded corners for the BusyContent border?

Binding IsBusy does not work

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);
}

IndicatorType "Swirl" is broken

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 LinearGradientBrushes from the Swirl.xaml template.

Constant CPU and GPU usage although BusyIndicator is not visible

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.

view use IsBusy binding prism's mode value invalid

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.