Blog Archives

Video Tutorial – Asynchronous Programming in .NET 4.5 (Task, async and await) – C# 5.0

Microsoft_DotNET_Logo

This is a great introduction video for Async Programming in .net 4.5 making multi threaded application super easy and bug free. In below tutorial You will learn following concepts Using Task Using Async and Await Keywords in .net 4.5

Tagged with: , ,
Posted in .net, C#, VB.net

XAML Error: The name ‘InitializeComponent’ does not exist in the current context

xaml

XAML designer is full of surprise so get ready for Binging … When you get below error then just remove Default constructor with InitializeComponent() call and everything will be fine. When I had UserControl on my main Windows Phone Project I

Tagged with:
Posted in C#, XAML

How to randomize sort order in dictionary using Linq

LINQ

I just came across need where I wanted to shuffle my dictionary with random order. Here is code snippet which uses Linq to randomize order of key/value pair you added. using System; using System.Linq; namespace MyApp { public class MyClass

Tagged with: ,
Posted in .net, C#, Linq

WPF Animation on Projection Property using code or XAML

xaml

If you try to define DoubleAnimation on Projection property then you will see lot of challenge. Here is How to fix. First make sure you create Name Attribute on Projection property like below for whatever UI element you want animate.

Tagged with: , , ,
Posted in .net, C#, Linq, SilverLight, WPF, XAML

Create 3D Effect using Projection in WPF/SilverLight

projection-xaml-silverlight-wpf-1

If you ever noticed then every FrameworkElement in WPF has property called Projection This property is very powerful if you use it right way. You can give 3D effect of any UI including Images in WPF/Silverlight Here is sample code

Tagged with: ,
Posted in .net, C#, SilverLight, WPF, XAML

XAML Animation – How to Scale and Rotate Object (Multiple Transformations)

xaml-animation.-scale-rotate-transformation

In this post I want to share snippet which shows simple technique to implement multiple transformations on same object. You will notice that in order to achieve this I have used TransformationGroup along with StoryBoard and DoubleAnimation private void Rotate_Click(object

Tagged with: , ,
Posted in .net, C#, XAML

Nullable types in C# and VB.net

Have you ever try to assign null to int value in C# or VB Both language has totally different behavior. VB allows you assign Nothing but it will translate to zero on the other end C# throws error “type is

Posted in .net, C#, Tips, VB.net

Hidden option for C# to enable real time ERRORS

C# Live Error Option

Have you ever got annoyed by C# IDE that you don’t find all errors until you compile project? If you ever worked with Visual Basic you will appreciate how much time saver it can be to detect all errors before

Tagged with:
Posted in .net, C#, Tips

How to Read Locked file in VB or C#

Have you ever got this error “File is being used by another process” Just try this create simple textfile on disk (e.g. mydata.txt) and open it with Excel… This way its locked (This is my trick to mimic locking of file) Now try

Tagged with: ,
Posted in .net, C#, VB.net