🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

Goffo.WpfLoadingSpinner

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Goffo.WpfLoadingSpinner

A custom Loading Spinner control for WPF applications

1.2.0
NuGet
Version published
Maintainers
1
Created
Source

README

What is this repository for?

  • Custom Loading Spinner Control for WPF Applications
  • NuGet Package: Goffo.WpfLoadingSpinner
  • Learn Markdown

How do I get set up?

  • XMAL Example
  • LabelLoadingContent puts a Text above the spinner
  • IsLoading controls if Spinner will display or be hidden
  • Diameter and Thickness control the size of the Spinner
  • Color and Foreground control the color of the spinner
  • HorizontalAlignment and HorizontalConentAlignment are for the LabelLoadingConent alignment above Spinner
<Window x:Class="LoadingSpinner.WPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:LoadingSpinner.WPF"
        xmlns:custom="clr-namespace:LoadingSpinner.CustomControl;assembly=LoadingSpinner.CustomControl"
        mc:Ignorable="d"
        Title="Loading Spinner" Height="600" Width="800">
    <Grid>
        <custom:LoadingSpinner Margin="20"
                               LabelLoadingContent="{Binding Title, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                               IsLoading="{Binding IsLoading, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                               HorizontalAlignment="Center" 
                               HorizontalContentAlignment="Center" 
                               FontWeight="Bold" 
                               FontSize="36" 
                               Thickness="15" 
                               Diameter="200" 
                               Color="#0098DB"
                               Foreground="#0098DB"
                               Grid.Row="0">
        </custom:LoadingSpinner>
	</Grid>
</Window>
  • ViewModel Code Behind Example
    public class MainViewModel : INotifyPropertyChanged
    {
        #region Constructor

        public MainViewModel()
        {
            ToggleLoadingCommand = new ToggleLoadingCommand(this);
            UpdateTitleCommand = new UpdateTitleCommand(this);
        }

        #endregion

        #region Properties

        private bool _isLoading;
        public bool IsLoading
        {
            get => _isLoading;
            set
            {
                _isLoading = value;
                OnPropertyChanged(nameof(IsLoading));
            }
        }

        private string _title = "LOADING...";

        public string Title 
        {
            get => _title;

            set
            {
                _title = value;
                OnPropertyChanged(nameof(Title));
            }
        }

        private string _stagingTitle = string.Empty;

        public string StagingTitle
        {
            get => _stagingTitle;

            set
            {
                _stagingTitle = value;
                OnPropertyChanged(nameof(StagingTitle));
            }
        }

        #endregion

        #region Commands

        public ICommand ToggleLoadingCommand { get; set; }

        public ICommand UpdateTitleCommand { get; set; }

        #endregion

        #region Methods

        public void ToggleLoadingSpinner()
        {
            IsLoading = !IsLoading;
        }

        public void UpdateTitle()
        {
            Title = StagingTitle;
        }

        #endregion

        #region Property Changed Event

        public event PropertyChangedEventHandler? PropertyChanged;

        protected void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        #endregion
    }

Contribution guidelines

  • Contact Repo Owner or Admin

Who do I talk to?

  • Repo owner or admin
  • Other community or team contact

FAQs

Package last updated on 04 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts