|
#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.
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