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

WPF Control State Persistency

, 9 Jun 2007
This article describes how to store and restore WPF's elements state, such as position, size, etc.
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;

namespace Tomers.WPF.State.Demo.Data
{
	class Consultants : ObservableCollection<Consultant>
	{
		public Consultants()
		{
			Add(new Consultant("Tomer", "Shamam", "http://blogs.microsoft.co.il/blogs/tomershamam"));
			Add(new Consultant("Alon", "Flies", "http://blogs.microsoft.co.il/blogs/alon"));
			Add(new Consultant("Emanuel", "Cohen-Yashar", "http://blogs.microsoft.co.il/blogs/applisec"));
			Add(new Consultant("Noam", "King", "http://blogs.microsoft.co.il/blogs/noam"));
		}
	}

	class Consultant
	{
		private string _firstName;
		public string FirstName
		{
			get { return _firstName; }
		}

		private string _lastName;
		public string LastName
		{
			get { return _lastName; }
		}

		private string _blog;
		public string Blog
		{
			get { return _blog; }
		}

		public Consultant(string firstName, string lastName, string blog)
		{
			this._firstName = firstName;
			this._lastName = lastName;
			this._blog = blog;
		}
	}
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Tomer Shamam
Architect CodeValue
Israel Israel
Tomer Shamam is a Software Architect and a UI Expert at CodeValue, the home of software experts, based in Israel (http://codevalue.net). Tomer is a speaker in Microsoft conferences and user groups, and in-house courses. Tomer has years of experience in software development, he holds a B.A degree in computer science, and his writings appear regularly in the Israeli MSDN Pulse, and other popular developer web sites such as CodePlex and The Code Project. About his thoughts and ideas you can read in his blog (http://blogs.microsoft.co.il/blogs/tomershamam).
Follow on   Twitter

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 10 Jun 2007
Article Copyright 2007 by Tomer Shamam
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid