Click here to Skip to main content
15,896,269 members
Articles / Desktop Programming / WPF

DesignSurface - WPF Designer Extension

Rate me:
Please Sign up or sign in to vote.
4.80/5 (4 votes)
13 Oct 2011CPOL7 min read 44.7K   3K   27  
Helps you extend WPF designer and design controls right on the designer

#region NameSpace Imports

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

#endregion

namespace Creatives.Design.Surface
{
	/// <summary>
	/// Defines <see cref="DesignerVerbCollection"/>.
	/// </summary>
	public class DesignerVerbCollection : IEnumerable<DesignerVerb>
	{
		#region Fields n Properties

		List<DesignerVerb> _verbs = new List<DesignerVerb>();

		internal List<DesignerVerb> Verbs
		{
			get { return _verbs; }
		}

		#endregion

		#region Implementations

		public void AddHeader(string header)
		{
			AddDesignerVerb(new DesignerVerb(header));
		}

		public void AddProperty(DependencyProperty proerty, string displayText)
		{
			AddDesignerVerb(new DesignerVerb(proerty, displayText));
		}

		public void AddDesignerVerb(DesignerVerb verb)
		{
			_verbs.Add(verb);
		}

		#endregion

		#region IEnumerable

		public IEnumerator<DesignerVerb> GetEnumerator()
		{
			foreach (DesignerVerb verb in _verbs)
				yield return verb;
		}

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return _verbs.GetEnumerator();
		}

		#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 Code Project Open License (CPOL)


Written By
Technical Lead
India India
I code, learn, read and listen.

Comments and Discussions