Saturday, February 21, 2009
Daily Links 21/02/2009
A more usable API for a mutable thread safe collection
migratordotnet
Migration Framework for .NET
Silverlight LinkLable Control
Silverlight gets minor update
just released: composite application guidance for wpf and silverlight - February 2008
Tracking down memory leaks in WPF and Silverlight
Porting WPF Applications to the Microsoft Surface
IIS7 Load Balancing & Routing Module Now Available!
Making extension methods amenable to mocking
The 32 Totally Essential (and Free) Apps for Every New PC
Get yourself a Window's Home Server
Wednesday, February 18, 2009
WPF Radio button binding (Enums and bug fixes)
I recently began implemented binding two radio buttons to a single enumeration value on an object, and was faced with two problems:
1) How do I bind the IsChecked boolean to an enumeration?
2) Once 1) was completed and even though it was using TwoWay binding, when the enum value was set outside of the UI, then the radio button would loose it's binding.
Here are the solutions:
1) Use a ValueConverter combined with ConverterParameter to bind the enumeration to the boolean IsChecked:
XAML:
<EnumBooleanConverter x:Key="ebc" /> <!-- declared in the UserControl Resources -->
...
<RadioButton x:Name="rdoMale" Content="Male" IsChecked="{Binding Path=Gender, Mode=TwoWay, Converter={StaticResource ebc}, ConverterParameter=Male}"/>
<RadioButton x:Name="rdoFemale" Content="Female" Margin="5" IsChecked="{Binding Path=Gender,Mode=TwoWay, Converter={StaticResource ebc},ConverterParameter=Female}"/>
C#:
public class EnumBooleanConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var ParameterString = parameter as string;
if (ParameterString == null)
return DependencyProperty.UnsetValue;
if (Enum.IsDefined(value.GetType(), value) == false)
return DependencyProperty.UnsetValue;
object paramvalue = Enum.Parse(value.GetType(), ParameterString);
return paramvalue.Equals(value);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
var ParameterString = parameter as string;
if (ParameterString == null)
return DependencyProperty.UnsetValue;
return Enum.Parse(targetType, ParameterString);
}
#endregion
}
..that worked great, until I set the value of the enum from code (ie: not by clicking the radio buton), so...
2) turns out, having read this post, it seems that if radio buttons belong to the same group, they confuse each other (or at least that's how I interpreted it). So I changed the XAML to:
<RadioButton GroupName="Male" x:Name="rdoMale" Content="Male" IsChecked="{Binding Path=Gender, Mode=TwoWay, Converter={StaticResource ebc}, ConverterParameter=Male}"/>
<RadioButton GroupName="Female" x:Name="rdoFemale" Content="Female" IsChecked="{Binding Path=Gender,Mode=TwoWay, Converter={StaticResource ebc},ConverterParameter=Female}"/>
... and it's "all sorted m8!" :)
Tuesday, February 17, 2009
Daily Links 17/02/2009
Integrating Reporting Services (SSRS) 2008 into Silverlight applications
Managing Dynamic Content Delivery In Silverlight, Part 2
Covers dynamic content management using Isolated storage as a permanent cache on the client
Component1 Silverlight xap Optimizer
Compressed my 1Meg xap to 717KB (winrar compression was 890KB)
Application Architecture Videos
Is the Relational Database Doomed?
Moonlight 1.0 released
Silverlight for Linux
It seems un-installing VS 2008 isn't quite as simple as one might think
Managed Custom Actions with Visual Studio 2010 and WiX 3.0
"WiX is much more flexible than the Visual Studio Setup Project currently available today and it supports managed code to interact with the Windows Installer"
Over 60 Free Controls from DevExpress
Free Winforms and ASP Controls from DevExpress
Microsoft Launches Windows Mobile 6.5
Thursday, February 12, 2009
Daily Links 12/02/2009
Major update to WPF Themes
UX Patterns in Silverlight
Integrating Silverlight and ASP.NET MVC
Using Ninject with Silverlight to make you code more testable
Web Deployment with VS 2010 and IIS
WPF Application Quality Guide
.NET Serialization wrappers
support for encryption, signing and compression
SharpDevelop 3.0 Final
For when you can't afford Visual Studio :)
Monday, February 9, 2009
Daily Links 09/02/2009
A Silverlight 2 Ad Rotator
Using C# Yield for Readability and Performance
Auto mocking Explained
Resharper an OutOfMemory Exceptions
Building a Nant Script -- Part 3: Adding Code Coverage w/ NCover
C# 4.0 features
WPF : Circular Progress Bar
Creating Rich Interactive Learning Materials Using Microsoft Semblio
xceed realtime zip for silverlight
Wednesday, February 4, 2009
Daily Links 04/02/2009
Cool Delegates
Cheap way of speeding up Visual Studio I/O
Microsoft Silverlight 3 features
Rhino Mocks 3.5 - Silverlight
Finally some silverlight mocking l33tness.
Silverlight Forms, Business Application & Validation Toolkits
Install SQL Server (Express) with your Application
WPF XAML Data Binding Cheat Sheet
Life changer XAML tip for Visual Studio
Damn - and I esp went and bought a wide-screen LCD so that I could see the xaml and the code at the same time :)
A comprehensive list to Silverlight Controls for developers