Click here to Skip to main content
12,065,204 members (39,920 online)
Click here to Skip to main content

Stats

57.3K views
2.7K downloads
57 bookmarked
Posted

Silverlight RIA Tasks 2: Dynamic View Models

, , , 18 Jul 2010 Ms-PL
Creating multiple dynamic Views using View Model Style and the Silverlight Tab Control.
RIATasks2.zip
RIATasks
RIATasks.Web
bin
RIATasks.Web.dll
ClientBin
RIATasks.xap
obj
Debug
TempPE
Properties
RIATasks.Web.csproj.user
RIATasksDB.dbml
RIATasksDB.dbml.layout
Assets
Bin
Debug
ar
System.Windows.Controls.resources.dll
bg
System.Windows.Controls.resources.dll
ca
System.Windows.Controls.resources.dll
cs
System.Windows.Controls.resources.dll
da
System.Windows.Controls.resources.dll
de
System.Windows.Controls.resources.dll
el
System.Windows.Controls.resources.dll
es
System.Windows.Controls.resources.dll
et
System.Windows.Controls.resources.dll
eu
System.Windows.Controls.resources.dll
fi
System.Windows.Controls.resources.dll
fr
System.Windows.Controls.resources.dll
he
System.Windows.Controls.resources.dll
hr
System.Windows.Controls.resources.dll
hu
System.Windows.Controls.resources.dll
id
System.Windows.Controls.resources.dll
it
System.Windows.Controls.resources.dll
ja
System.Windows.Controls.resources.dll
ko
System.Windows.Controls.resources.dll
lt
System.Windows.Controls.resources.dll
lv
System.Windows.Controls.resources.dll
ms
System.Windows.Controls.resources.dll
nl
System.Windows.Controls.resources.dll
no
System.Windows.Controls.resources.dll
pl
System.Windows.Controls.resources.dll
pt
pt-BR
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
RIATasks.dll
RIATasks.xap
ro
System.Windows.Controls.resources.dll
ru
System.Windows.Controls.resources.dll
sk
System.Windows.Controls.resources.dll
sl
System.Windows.Controls.resources.dll
sr-Cyrl-CS
System.Windows.Controls.resources.dll
sr-Latn-CS
System.Windows.Controls.resources.dll
sv
System.Windows.Controls.resources.dll
System.CoreEx.dll
System.Observable.dll
System.Reactive.dll
System.Windows.Controls.dll
System.Windows.Interactivity.dll
th
System.Windows.Controls.resources.dll
tr
System.Windows.Controls.resources.dll
uk
System.Windows.Controls.resources.dll
vi
System.Windows.Controls.resources.dll
zh-Hans
System.Windows.Controls.resources.dll
zh-Hant
System.Windows.Controls.resources.dll
Classes
Controls
ViewModels
Views
Models
obj
Debug
Assets
Controls
Views
TempPE
Properties
RIATasks.csproj.user
SampleData
Service References
wsRIATasks
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
RIATasks.wsRIATasks.DeleteTaskResponse.datasource
RIATasks.wsRIATasks.GetTasksResponse.datasource
RIATasks.wsRIATasks.InsertTaskResponse.datasource
RIATasks.wsRIATasks.UpdateTaskResponse.datasource
WebService.disco
WebService.wsdl
ServiceReferences.ClientConfig
ViewModels
RIATasks2ABVersion.zip
RIATasks.Web.dll
RIATasks.xap
RIATasks.Web.csproj.user
RIATasksDB.dbml
RIATasksDB.dbml.layout
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
RIATasks.dll
RIATasks.xap
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.CoreEx.dll
System.Observable.dll
System.Reactive.dll
System.Windows.Controls.dll
System.Windows.Interactivity.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
Resources
Resources
RIATasks.csproj.user
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
RIATasks.wsRIATasks.DeleteTaskResponse.datasource
RIATasks.wsRIATasks.GetTasksResponse.datasource
RIATasks.wsRIATasks.InsertTaskResponse.datasource
RIATasks.wsRIATasks.UpdateTaskResponse.datasource
WebService.disco
WebService.wsdl
ServiceReferences.ClientConfig
RIATasks2Hiro.zip
RIATasks.Web.dll
RIATasks.xap
RIATasks.Web.csproj.user
RIATasksDB.dbml
RIATasksDB.dbml.layout
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
RIATasks.dll
RIATasks.xap
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
ScrollViewerScroll.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.CoreEx.dll
System.Observable.dll
System.Reactive.dll
System.Windows.Controls.dll
System.Windows.Interactivity.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
System.Windows.Controls.resources.dll
RIATasks.csproj.user
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
RIATasks.wsRIATasks.DeleteTaskResponse.datasource
RIATasks.wsRIATasks.GetTasksResponse.datasource
RIATasks.wsRIATasks.InsertTaskResponse.datasource
RIATasks.wsRIATasks.UpdateTaskResponse.datasource
WebService.disco
WebService.wsdl
ServiceReferences.ClientConfig
ScrollViewerScroll
Bin
Debug
ScrollViewerScroll.dll
System.Windows.Interactivity.dll
obj
Debug
TempPE
Properties
ScrollViewerScroll.csproj.user
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace RIATasks.Web
{
	using System.Data.Linq;
	using System.Data.Linq.Mapping;
	using System.Data;
	using System.Collections.Generic;
	using System.Reflection;
	using System.Linq;
	using System.Linq.Expressions;
	using System.ComponentModel;
	using System;
	
	
	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="RIATasks")]
	public partial class RIATasksDBDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertTask(Task instance);
    partial void UpdateTask(Task instance);
    partial void DeleteTask(Task instance);
    #endregion
		
		public RIATasksDBDataContext() : 
				base(global::System.Configuration.ConfigurationManager.ConnectionStrings["RIATasksConnectionString"].ConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public RIATasksDBDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public RIATasksDBDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public RIATasksDBDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public RIATasksDBDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<Task> Tasks
		{
			get
			{
				return this.GetTable<Task>();
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Tasks")]
	public partial class Task : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _TaskID;
		
		private string _TaskName;
		
		private string _TaskDescription;
		
		private int _UserID;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnTaskIDChanging(int value);
    partial void OnTaskIDChanged();
    partial void OnTaskNameChanging(string value);
    partial void OnTaskNameChanged();
    partial void OnTaskDescriptionChanging(string value);
    partial void OnTaskDescriptionChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    #endregion
		
		public Task()
		{
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TaskID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int TaskID
		{
			get
			{
				return this._TaskID;
			}
			set
			{
				if ((this._TaskID != value))
				{
					this.OnTaskIDChanging(value);
					this.SendPropertyChanging();
					this._TaskID = value;
					this.SendPropertyChanged("TaskID");
					this.OnTaskIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TaskName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string TaskName
		{
			get
			{
				return this._TaskName;
			}
			set
			{
				if ((this._TaskName != value))
				{
					this.OnTaskNameChanging(value);
					this.SendPropertyChanging();
					this._TaskName = value;
					this.SendPropertyChanged("TaskName");
					this.OnTaskNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TaskDescription", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
		public string TaskDescription
		{
			get
			{
				return this._TaskDescription;
			}
			set
			{
				if ((this._TaskDescription != value))
				{
					this.OnTaskDescriptionChanging(value);
					this.SendPropertyChanging();
					this._TaskDescription = value;
					this.SendPropertyChanged("TaskDescription");
					this.OnTaskDescriptionChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
#pragma warning restore 1591

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 Microsoft Public License (Ms-PL)

Share

About the Authors

defwebserver
Software Developer (Senior) http://ADefWebserver.com
United States United States
Michael Washington is a Microsoft MVP. He is a ASP.NET and
C# programmer.
He is the founder of
LightSwitchHelpWebsite.com

He has a son, Zachary and resides in Los Angeles with his wife Valerie.

He is the Author of:

Alan Beasley
User Interface Analyst
United Kingdom United Kingdom
I've been playing with computers since my first Acorn Electron, & after blowing up a few ZX Spectrums. I moved on to the C64 & Amiga, & eventually reluctantly on to the PC.

I have learnt a wide set of skills during my 38 years of existence, living in the UK, on the sunny south coast.

My main area of expertise is Graphic/Visual Design, Usability & UI Design. I am not a programmer, but am fairly technically minded due to studying Mechanical Engineering at Uni.

I have work both Freelance & for IBM as a Graphic Designer, & am skilled in the usual graphics packages like, PhotoShop, CorelDraw or Illustrator, Premier, Dreamweaver, Flash etc.
But I originally started with Lightwave & 3D animation.

hisowa
Software Developer
United States United States
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160204.4 | Last Updated 18 Jul 2010
Article Copyright 2010 by defwebserver, Alan Beasley, hisowa
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid