Category Archives: WPF

Use x:Shared to write your FrameworkElements directly as Resource

By | July 25, 2011

We all know that StaticResource works mainly with Freezables in WPF. You cannot define a resource like a Button or a TextBox as StaticResource because the runtime will count it to be shared and creating the resource more than once from Resources will leave you an exception.

Use BitmapScalingMode to ensure your rendering of Image is perfect

By | July 20, 2011

If you have worked with WPF 3.5 before, you know that declaring a normal image in your code will render your image quite fine. But If you do the same thing in .NET 4.0 or even you convert your existing application from previous version to .NET 4.0, all the images that were rendering quite Ok in your previous… Read More »

AncestorType in RelativeSource – Silverlight 5

By | April 19, 2011

WPF has a facility to search the AncestorType for a control from a child control such that it will find the next parent control that matches the Ancestor Type defined. Silverlight implements this feature to enable you to search your ancestor from child control from your visual tree and bind the child property with it. Lets take a… Read More »

Pixel Scrolling for WPF Lists

By | March 23, 2011

WPF comes with lots of fun and advantages. We can change the look and behavior of a control very easily which would have been very cumbersome when we are in normal winforms applications. WPF has few flexibilities like Superior Binding capabilities, Animation, Transformation, Virtualizations etc. Each of these made the framework richer in all respect. In WPF, ListBox… Read More »