Geeks With Blogs

News




What I do:

Identity Mine

MVVM Light

GalaSoft


What I am:

Microsoft Most Valuable Professional, Client Application Development

Microsoft Certified Technology Specialist, Windows Presentation Foundation

WPF disciples


Social:


View my profile on LinkedIn

XING
Creative Commons License
Diary of a Code Trotter by Laurent Bugnion is licensed under a Creative Commons Attribution 3.0 Unported License

All source code on this blog is licensed under the MIT license.

Copyright (c) 2006 - 2011 GalaSoft Laurent Bugnion

Laurent Bugnion (GalaSoft) Diary of a Code Trotter

One question on the WPF forum caught my attention. It was a nice challenge, so I decided to give it a try. It turned out not bad, so I thought I would post it on my website for future reference. The question is: How to display all the cultures in a ListBox, and filter to display only these starting with "en-". Good news is: you can do a lot of that in XAML only. Bad news is: If you want to filter, you need code-behind.

I posted a comprehensive example on my website's articles section. It shows how to initialize an ObjectDataProvider using the static method CultureInfo.GetCultures. Since this method needs a parameter, I also show how to pass the right value to the method.

Then I show how to use CollectionViewSource to sort and group a view of that list in pure XAML. Finally, I show how to filter the list using the same CollectionViewSource and an event handler in code behind.

Posted on Saturday, August 11, 2007 9:00 PM Technical stuff , .NET , WPF | Back to top


Comments on this post: WPF: Getting, sorting and filtering information in pure XAML (well almost)

Comments are closed.
Comments have been closed on this topic.
Copyright © Laurent Bugnion | Powered by: GeeksWithBlogs.net