Click here to Skip to main content
15,886,809 members
Articles / Desktop Programming / WPF

WPF.JoshSmith

Rate me:
Please Sign up or sign in to vote.
4.99/5 (51 votes)
13 Jul 2008CPOL5 min read 389.8K   4.8K   263  
A free library of controls and utility classes for use in WPF applications.
using System;
using System.Collections.ObjectModel;

namespace Test.ListViewDragDropManager
{
	enum TaskDuration
	{
		Unknown,
		VeryShort,
		Short,
		Medium,
		Long,
		VeryLong
	}

	class Task
	{
		public static ObservableCollection<Task> CreateTasks()
		{
			ObservableCollection<Task> list = new ObservableCollection<Task>();

			list.Add( new Task( TaskDuration.VeryShort, "Take out trash", "The trash can is full again.", false ) );
			list.Add( new Task( TaskDuration.Short, "Clean the bathroom", "It's my turn to scrub the tub. :(", true ) );
			list.Add( new Task( TaskDuration.Medium, "Write CodeProject article", "Need to write a CP article about ListViewDragDropManager.", true ) );
			//list.Add( null ); // Test what happens when there is a null item in the ListView.
			list.Add( new Task( TaskDuration.VeryLong, "Learn 3D programming", "Learn how to create slick UIs using the WPF 3D APIs.", false ) );
			list.Add( new Task( TaskDuration.Unknown, "Get in touch with Tom", "It's been a while since I've spoken with him.", false ) );

			return list;
		}	

		TaskDuration duration; 
		string name;		
		string description;
		bool finished;

		public Task( TaskDuration duration, string name, string description, bool finished )
		{
			this.duration = duration;
			this.name = name;
			this.description = description;
			this.finished = finished;
		}

		public bool Finished
		{
			get { return this.finished; }
			set { this.finished = value; }
		}

		public TaskDuration Duration
		{
			get { return duration; }
		}

		public string Name
		{
			get { return name; }
		}

		public string Description
		{
			get { return this.description; }
		}
	}
}

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
Software Developer (Senior)
United States United States
Josh creates software, for iOS and Windows.

He works at Black Pixel as a Senior Developer.

Read his iOS Programming for .NET Developers[^] book to learn how to write iPhone and iPad apps by leveraging your existing .NET skills.

Use his Master WPF[^] app on your iPhone to sharpen your WPF skills on the go.

Check out his Advanced MVVM[^] book.

Visit his WPF blog[^] or stop by his iOS blog[^].

See his website Josh Smith Digital[^].

Comments and Discussions