Click here to Skip to main content
11,642,402 members (63,807 online)
Click here to Skip to main content
Add your own
alternative version

Managing Multiple selection in View Model (.NET Metro Style Apps)

, 29 Jun 2012 CPOL 30.6K 1.9K 12
This article provides Attached Behavior based approach to manage Multiple Selection in Collection Based UI control from the View Model. All the code in this article is strictly applicable to Win 8 metro style apps. Though the Behaviors can be easily adapted to WPF/Silverlight.
Multiselect_in_VM.zip
Multiselect in VM
~$ltiselect Binding in ViewModel-Metro.docx
~$w Microsoft Word Document.docx
Ext
winrtbehaviors-14177.zip
winrtbehaviors-14177
Multiselect Binding in ViewModel-Metro.docx
MultiselectSample
depend
GalaSoft.MvvmLight.Win8.dll
WinRtBehaviors.dll
MultiselectSample
Assets
Logo.png
SmallLogo.png
SplashScreen.png
StoreLogo.png
bin
Debug
AppX
Assets
Logo.png
SmallLogo.png
SplashScreen.png
StoreLogo.png
Common
GalaSoft.MvvmLight.Win8.dll
microsoft.system.package.metadata
S-1-5-21-860198490-3370951563-2996008965-1001.pckgdep
MultiselectSample.exe
resources.pri
vs.appxrecipe
WinRtBehaviors.dll
WinRtExt.dll
Common
GalaSoft.MvvmLight.Win8.dll
MultiselectSample.build.appxrecipe
MultiselectSample.exe
resources.pri
WinRtBehaviors.dll
WinRtExt.dll
WinRtExt.pri
Common
MultiselectSample_TemporaryKey.pfx
obj
Debug
Common
intermediatexaml
TempPE
Package.appxmanifest
Properties
WinRtBehaviors
bin
Debug
WinRtBehaviors.dll
WinRtBehaviors.pri
obj
Debug
TempPE
Properties
WinRtBehaviors.csproj.vspscc
WinRtBehaviors.vssscc
WinRtExt
Behavior
bin
ARM
Debug
Release
Debug
WinRtBehaviors.dll
WinRtBehaviors.pri
WinRtExt.dll
WinRtExt.pri
Release
x64
Debug
Release
x86
Debug
Release
obj
Debug
TempPE
Properties
ori

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiselectSample", "MultiselectSample\MultiselectSample.csproj", "{CA8EA475-B362-4C46-8F25-30B0ED9229D5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinRtExt", "WinRtExt\WinRtExt.csproj", "{032846D1-A1D2-4C47-A02C-8E0003744D5C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{38A0D5E6-925F-4698-83AD-E3AFC53D9F4A}"
	ProjectSection(SolutionItems) = preProject
		Steps.txt = Steps.txt
	EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dependencies", "dependencies", "{40FADD60-FD82-4D0E-86EE-37117A52C947}"
	ProjectSection(SolutionItems) = preProject
		depend\GalaSoft.MvvmLight.Win8.dll = depend\GalaSoft.MvvmLight.Win8.dll
		depend\WinRtBehaviors.dll = depend\WinRtBehaviors.dll
	EndProjectSection
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|ARM = Debug|ARM
		Debug|Any CPU = Debug|Any CPU
		Debug|x64 = Debug|x64
		Debug|x86 = Debug|x86
		Release|ARM = Release|ARM
		Release|Any CPU = Release|Any CPU
		Release|x64 = Release|x64
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Debug|ARM.ActiveCfg = Debug|ARM
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Debug|ARM.Build.0 = Debug|ARM
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Debug|x64.ActiveCfg = Debug|x64
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Debug|x64.Build.0 = Debug|x64
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Debug|x86.ActiveCfg = Debug|x86
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Debug|x86.Build.0 = Debug|x86
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Release|ARM.ActiveCfg = Release|ARM
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Release|ARM.Build.0 = Release|ARM
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Release|Any CPU.Build.0 = Release|Any CPU
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Release|x64.ActiveCfg = Release|x64
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Release|x64.Build.0 = Release|x64
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Release|x86.ActiveCfg = Release|x86
		{032846D1-A1D2-4C47-A02C-8E0003744D5C}.Release|x86.Build.0 = Release|x86
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|ARM.ActiveCfg = Debug|ARM
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|ARM.Build.0 = Debug|ARM
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|ARM.Deploy.0 = Debug|ARM
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|x64.ActiveCfg = Debug|x64
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|x64.Build.0 = Debug|x64
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|x64.Deploy.0 = Debug|x64
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|x86.ActiveCfg = Debug|x86
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|x86.Build.0 = Debug|x86
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Debug|x86.Deploy.0 = Debug|x86
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|ARM.ActiveCfg = Release|ARM
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|ARM.Build.0 = Release|ARM
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|ARM.Deploy.0 = Release|ARM
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|Any CPU.Build.0 = Release|Any CPU
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|Any CPU.Deploy.0 = Release|Any CPU
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|x64.ActiveCfg = Release|x64
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|x64.Build.0 = Release|x64
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|x64.Deploy.0 = Release|x64
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|x86.ActiveCfg = Release|x86
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|x86.Build.0 = Release|x86
		{CA8EA475-B362-4C46-8F25-30B0ED9229D5}.Release|x86.Deploy.0 = Release|x86
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(NestedProjects) = preSolution
		{40FADD60-FD82-4D0E-86EE-37117A52C947} = {38A0D5E6-925F-4698-83AD-E3AFC53D9F4A}
	EndGlobalSection
EndGlobal

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)

Share

About the Author

Fun@learn
Software Developer (Senior)
India India
Software Engineer based out in Noida.

Technology skillset – .NET, WPF, WCF, LINQ, XAML.

Started blogging on http://1wpf.wordpress.com/


Stackoverflow Profile -> http://stackoverflow.com/users/649524/tilak

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150731.1 | Last Updated 29 Jun 2012
Article Copyright 2012 by Fun@learn
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid