Limitations of Private Accessors and Generic Methods (JIT Compiler Encountered an Internal Limitation)

Private accessors are really helpful for extensive unit testing. But they do have their limitations. I wrote a generic protected method having a declaration like this: protected ReturnType MyMethod<T>(OneClass, DateTime, DateTime, Func<OtherClass, T>, out List<T>); Calling this method via an accessor in my unit test, I ran into an exception …

Silverlight Printing and Inheritance of Language Settings

From what I learned, printing in Silverlight (4) is straight forward: Create a control and print it. I used this pattern in a Silverlight application I built. Because I had to implement some multipage- and list handling, I created user controls that I added into a stack panel of the …

Generic UserControl Base Class in Silverlight

Having generics in .NET is a great thing. I already loved template classes in C++, missed them in .NET 1.x, and was happy to get a (little bit restricted) kind of templates in .NET 2.0. Building a Silverlight application, I felt the need to create a generic UserControl base class. …

Silverlight’s DatePicker and Telerik’s RadWindow Dialog

In my current Silverlight project, I’m using the DatePicker control, which is part of the Silverlight SDK. In one scenario, the DatePicker with TwoWay binding is embedded into a User Control, which itself is embedded into another User Control. The format is “dd.MM.yyyy”. Entering e.g. 23.11.2011 works fine, means the …

Refresh A Silverlight Control That Is Using A Converter

One of the great things of Silverlight – from my point of view – is the introduction of converters to format the content if a control, e.g. a text box. Well, the idea itself isn’t new, but it is the first time I saw it built in a Microsoft UI …

Using Styles From Different Class Library In Silverlight

For re-use purposes, it is helpful to put Silverlight styles into a separate class library; let’s call it ResourceLibrary in this example. In the class library which is using the styles from ResourceLibrary, one should declare a Styles.xaml, which only contains a reference to ResourceLibrary: <ResourceDictionary xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”> <ResourceDictionary.MergedDictionaries> <ResourceDictionary …

Why Silverlight Binding’s StringFormat Property Sometimes Isn’t Fully Working

In Silverlight 4, the new Binding property StringFormat was introduced. It’s a nice thing, e.g. if you want to display numeric values with digit grouping and a fix number of decimal places. The syntax is equal to the String.Format: {Binding DataContextProperty StringFormat=’#,##0.00′}. One can, of course, use it for other …

Large Message Size And Bad Request on WCF Service

In an application I built, using Silverlight Client and WCF Service, the application threw an exception when the request data passed by the client to the server exceeded about 64K (might be a little bit less). Using a TCP tracer, I saw that the client received a “bad request” error. …

machine.config Overrides TransactionScope / TransactionOptions.Timeout

You are wondering why your DB-transaction, startet by using(TransactionScope scope = new TransactionScope(timeout)) runs into a timeout after 10 minutes? Because the <machineSettings maxTimeout=”00:10:00″/> in the system.transactions section of the machine.config has a default value of 10 minutes. And whatever is set as timeout of the TransactionScope by code – …