Posts

Showing posts with the label Muhammad Rizwan

Dynamically Generating Controls in WPF and Silverlight

Image
Some of the Windows Forms developers I've spoken to have said that one thing they want to learn is how to dynamically create controls in WPF and Silverlight. In this post I'll show you several different ways to create controls at runtime using Silverlight 4 and WPF 4. First, we'll start with how to create controls in XAML. From there, we'll move to dynamically-loaded XAML before we take a look at using the CLR object equivalents.   Creating Controls at Design Time in XAML Creating controls using the design surface and/or XAML editor is definitely the easiest way to create your UI. You can use Expression Blend or Visual Studio, depending upon how creative you want to be. If you want a more dynamic layout, you can hide and show panels at runtime. Here's an example layout: <Grid Margin= "10" > <Grid.ColumnDefinitions> <ColumnDefinition Width= "100" /> <ColumnDefinition Width= "*" /> ...

Tomb stoning on the Win7 Mobile Platform

Image
Tomb stoning is  the process of saving the data and state of your application when it’s terminated such that it can resume where it left off when it is started back up again. There are many cases where you application may be suddenly terminated on the phone. Examples include incoming phone calls or activation of the camera on the device. Tomb stoning is an essential feature that almost every application should support to avoid customer frustration with your application. Tomb stoning an application is fairly straightforward. Every application on the phone has its own permanent storage space on the device that is referred to as isolated storage. Classes for isolated storage can be found in under the System.IO.IsolatedStorage namespace. You can use these classes to store and reload the state and data for your application. In your App.xaml file, the events you should monitor for are the following: Application_Launching – Code to execute when the application is launching. This c...

12 Things A Software Engineer Really Needs To Know

How do you answer the question, “what do I need to learn to be a good programmer?” I have written posts trying to answer that question, typically focusing on the languages that you should learn or the algorithms and other techniques you need to know. What about the rest of a programmer’s life? This is a less serious look at the life of a programmer. So, what does a programmer really need to know? 1.Caffeine – You need to find your preferred caffeine delivery system. Mine is black coffee, early and often. Others may prefer diet soda throughout the day. There are always the classics as well, Mountain Dew and Jolt. 2.Logic – As a programmer, you deal with logic constantly. Your true mettle will be defined by how you deal with the insanity (real or perceived) of the customer. The customer could be your project manager, the business analyst or the users. For any given project, you can count on someone sounding completely insane. 3.Hours – Expect to be working a lot of them. Program...