Click here to Skip to main content
15,885,365 members
Articles / Desktop Programming / WPF

WPFSpark: 6 of n: FluidProgressBar

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
19 Jan 2012Ms-PL4 min read 45.2K   1.5K   20  
A Windows Phone style indeterminate ProgressBar in WPF.
#region File Header

// -------------------------------------------------------------------------------
// 
// This file is part of the WPFSpark project: http://wpfspark.codeplex.com/
//
// Author: Ratish Philip
// 
// WPFSpark v1.0
//
// -------------------------------------------------------------------------------

#endregion

using System.Windows;
using System.Windows.Controls;

namespace WPFSpark
{
    public class NotifiableUIElementCollection : UIElementCollection
    {
        #region Fields

        private INotifiableParent parent; 

        #endregion

        #region Construction / Initialization

        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="visualParent">Visual Parent</param>
        /// <param name="logicalParent">Logical Parent</param>
        public NotifiableUIElementCollection(UIElement visualParent, FrameworkElement logicalParent)
            : base(visualParent, logicalParent)
        {
            parent = (INotifiableParent)logicalParent;
        }
        
        #endregion

        #region Overrides

        /// <summary>
        /// Adds a child to the parent
        /// </summary>
        /// <param name="element">child element</param>
        /// <returns></returns>
        public override int Add(System.Windows.UIElement element)
        {
            if (parent != null)
                return parent.AddChild(element);

            return -1;
        }
        
        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Software Developer
United States United States
An individual with more than a decade of experience in desktop computing and mobile app development primarily on the Microsoft platform. He loves programming in C#, WPF & XAML related technologies.
Current interests include web application development, developing rich user experiences across various platforms and exploring his creative side.

Ratish's personal blog: wpfspark.wordpress.com

Comments and Discussions