IBlog<Johan>

This and that in a developer's life in general

News

Follow johandanforth on Twitter

Random Links

Walkthroughs and Tutorials

Browse by Tags

All Tags » c# (RSS)
Binding MediaElement to a ViewModel in a Windows 8 Store App
If you want to play a video from your video-library in a MediaElement control of a Metro Windows Store App and tried to bind the Url of the video file as a source to the MediaElement control like this, you may have noticed it’s not working as well for...
Posted: Dec 14 2012, 03:07 PM by jdanforth | with 3 comment(s)
Filed under: ,
File Activation in Windows RT
The code sample for file activation on MSDN is lacking some code so a simple way to pass the file clicked to your MainPage could be: protected override void OnFileActivated( FileActivatedEventArgs args) { var page = new Frame (); page.Navigate( typeof...
Posted: Nov 23 2012, 11:57 AM by jdanforth | with 1 comment(s)
Filed under: , , , , ,
Read All Text from Textfile with Encoding in Windows RT
A simple extension for reading all text from a text file in WinRT with a specific encoding, made as an extension to StorageFile: public static class StorageFileExtensions {     async public static Task<string> ReadAllTextAsync(this...
Posted: Nov 21 2012, 03:53 PM by jdanforth
Filed under: , ,
MiniBuss on Codeplex
The micro service bus framework for msmq called MiniBuss is now open source on Codeplex at http://minibuss.codeplex.com There is also now a NuGet package available for easy install into projects: If you’re interested in co-op on this project, please contact...
Create Tag-Cloud from RSS Feed in ASP.NET MVC
Say you want to generate your own tag-cloud from a list of categories or tags you pull from an RSS-feed or similar. This is one way to do it. I’m using ASP.NET MVC for this sample which creates a simple tag-cloud in a Razor-view with HTML looking something...
Posted: Aug 08 2011, 01:40 PM by jdanforth
Filed under: , ,
Refactored Dapper Extensions
Making extensions for Dapper-dot-net was so fun and I needed a few more simple ones so I refactored a bit and made a few Update() and Delete() extensions as well. I’m also looking for Id-properties with the [Key] attribute on them. The class grew a bit...
Posted: May 11 2011, 12:48 AM by jdanforth | with 2 comment(s)
Filed under: ,
Simple Insert Extension for Dapper
Last week I started using Dapper ( dapper-dot-net on Google Code ) for a project I’m working on. Dapper is a micro ORM, which extends IDbConnection. It’s very fast and works very well for queries where you want to return both typed and dynamic lists of...
Posted: May 10 2011, 07:20 PM by jdanforth | with 11 comment(s)
Filed under: ,
Case Switching on CLR Types
As most .NET developers know, you cannot do case/switch on CLR types and one of the reasons for it was explained pretty well years ago by Peter Hallam on the C# team . But there are many cases where you would like to iterate through a list of objects...
More Posts