Silverlight Feeds - All your Silverlight feeds in one place.

Sponsors

Feed: Brendan Enrick

Site: http://brendan.enrick.com/ Link: http://feeds.feedburner.com/BrendanEnrick

Friday, January 27, 2012

Foreach, IEnumerable, IEnumerator, and Duck Typing

by admin via Brendan Enrick on 1/27/2012 10:00:00 AM

During my Software Craftsmanship Precompiler session, I heard one of the students say, “all you need is an IEnumerable to use a foreach loop”. This sparked a bit of fun when I asked Steve Smith, my co-presenter, if that was correct. He confirmed that it was, and I disagreed. Being the scientists that we are, we decided to try it and see what happened. I of course knew that duck typing in C# should allow the Foreach loop to compile without anything having the method required by the IEnumerable in ...

[ read more ]

Sunday, October 24, 2010

Wire up your ViewModels using a Service Locator

by admin via Brendan Enrick on 10/24/2010 2:57:34 PM

No MVVM solution is complete without having the DataContext bound to a ViewModel, but this wouldn’t be a fun development community if there were not some disagreement on the specifics of how to achieve certain goals. I will be recommending how I like to wire up ViewModels. There are other ways of doing this, but I will explain some of the reasons I use this method. You can start by building a View that needs to have certain traits in its ViewModel and then create a well-tested ViewModel separat ...

[ read more ]

Wednesday, October 13, 2010

Making Text Clickable in Silverlight for Windows Phone 7

by admin via Brendan Enrick on 10/13/2010 9:09:53 AM

I’ve seen a lot of snippets of code online where people are trying to make text clickable in Windows Phone 7, and plenty of them are using the OnMouseLeftButtonDown event to do it. Well to put this lightly, this is not the best way of handling a click in the Windows Phone 7 environment. The reason is that we have to put the “left button” down in order to scroll. The “left button” is our finger, so if we try to scroll down and press our finger on the text we will be activating the event by mistak ...

[ read more ]

Wednesday, October 06, 2010

Accessing the ViewModel Inside a DataTemplate in Silverlight

by admin via Brendan Enrick on 10/6/2010 10:40:10 AM

I’ve been doing a lot of Windows Phone 7 Development, which means that I have also been doing a lot of Silveright development, so here is a tip for accessing your ViewModel when you’re in a DataTemplate. In Silveright, DataTemplates are used when binding data to a control. For example if I want to list users I will define the DataTemplate, which will define the XAML that will be bound to for each of the users in the list. When I do this, the data context for the DataTemplate is my user and no l ...

[ read more ]

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us