Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

WPF HTML Supported TextBlock

, 7 Feb 2009
This article describes HtmlTextBlock which is a WPF TextBlock that can parse a limited set of HTML tags and display them.
/*
 * Created by SharpDevelop.
 * User: LYCJ
 * Date: 27/10/2007
 * Time: 21:52
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Collections;
using System.Collections.Generic;

namespace QuickZip.MiniHtml2
{
	
	
	/// <summary>
	/// Description of DependencyProterty.
	/// </summary>
	public class DependencyProperty<AnyType>
	{
		private static List<DependencyProperty<AnyType>> dependencyPropertyList = new List<DependencyProperty<AnyType>>();				
		private string name;
		private object propertyValue;
		private Type propertyType;
		private Type ownerType;
		private PropertyMetadata typeMetadata;
		private ValidateValueCallback validateValueCallback;
		
		public Type PropertyType { get { return propertyType; } }		
		internal object PropertyValue
		{
			get { return propertyValue; }
			set { propertyValue = value; CallValidateValueCallback(); }
		}
			
		
		
		
		private DependencyProperty(string aName, Type aPropertyType, 
		                           Type anOwnerType, PropertyMetadata aTypeMetadata,
		                           ValidateValueCallback aValidateValueCallback)
		{
			name = aName;
			propertyType = aPropertyType;
			ownerType = anOwnerType;
			typeMetadata = aTypeMetadata;
			validateValueCallback = aValidateValueCallback;
		}
			
		public static DependencyProperty<AnyType> Register(string name, Type propertyType, 
		                                          Type ownerType, PropertyMetadata typeMetadata,
		                                          ValidateValueCallback validateValueCallback)
		{
			DependencyProperty<AnyType> retVal = new DependencyProperty<AnyType>(name, propertyType, ownerType, 
			                                                   typeMetadata, validateValueCallback);
			
			
			
			
			dependencyPropertyList.Add(retVal);
			return retVal;
		}
		
		public static void SetValue(DependencyProperty<AnyType> property, object propertyValue)
		{			
			property.PropertyValue = propertyValue;
		}
		
		public static object GetValue(DependencyProperty<AnyType> property)
		{
			return property.PropertyValue;
		}
		
		
		private void CallValidateValueCallback()
		{
			if (validateValueCallback != null)
				validateValueCallback(this, new ValidateValueEventArgs());
		}
	}
	
	
	internal class DependencyPropertyList
	{
		
	}
	
	public class PropertyMetadata
	{
		
	}
	
	public class ValidateValueEventArgs : EventArgs
	{
		
	}
	
	public delegate void ValidateValueCallback(Object sender, ValidateValueEventArgs e);	
}

		

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 GNU Lesser General Public License (LGPLv3)

About the Author


| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 7 Feb 2009
Article Copyright 2009 by Leung Yat Chun
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid