Tuesday, May 21, 2013

Checkbox WPF – Making checkbox readonly in WPF


As the title suggests, following is the way by which you can make a checkbox readonly in WPF.
Let’s have a look at typical checkbox XAML –
<CheckBox Content="CheckBox" Name="checkBox1" />
Now to make this checkbox read only – we need to add two following properties to XAML statement above.

Those two Properties are – IsHitTestVisible and Focusable
Make thse two properties to False. This makes the readonly checkbox in WPF.
So final XAML statement will be as follows for readonly checkbox in WPF –  

<CheckBox Content="CheckBox" Name="checkBox1" IsHitTestVisible="False" Focusable="False"/> 

Hope this helps.

Cheers…

Happy Coding!!

Saturday, October 6, 2012

Samsung Galaxy Camera – Review and Features


“Click and Share” is the motto of today’s generation. Today’s youngsters love to capture happy-sad moments in camera. Companies exactly figured out this need and brought digital cameras in very low price. However, after clicking your favourite snap, to share it on social networking sites; it is mandatory to connect camera to laptop or computer. To overcome these problem mobile companies came up with new idea – Smart phones. Now you can capture photo and share it on social networking sites using smart phones.


Today the giant name is smart phones market is Samsung. It is very interesting to see launch of every new product from Samsung. In every product they have designed; one can easily find out the balance Samsung provide in quality and cost effectiveness. If you consider this history of Samsung; I must say now Samsung have taken a very bold step. “We are bringing a camera to change the definition of photography” Samsung claims! The name is – Samsung Galaxy Camera. Camera operates on Android 4.1 Jelly Bean. Gone are the days of being jealous for not having high end cameras for commercial use. Samsung Galaxy Camera can be used for commercial and high end photography. Let’s understand its basic but new important features – 


Smart Pro Mode – 

Be ready to capture excellent photos. Smart PRO MODE will help you to capture various colours at night as well. Or you can capture a high speed scene with action freeze. For example, you can capture a bike rider with action freeze on a simple button click!!







Monday, September 3, 2012

WPF custom control and adding DependencyProperty to custom control


To create custom control in WPF, choose WPF Custom Control Library project in VS2010. Then rename the default added class to your choice. I am trying to create a custom list box with few user added properties in it. Then add a WPF project which will use this custom list box in it. So my solution structure is as follows –

Now I am going to add dependency properties in the class file. These properties will be then available in Properties window once you use the control in any WPF application.

Thursday, August 30, 2012

WPF – MVVM – Combobox binding with enums


WPF and MVVM is going smooth for me at least as of now. Today, I am going to disucss how combobx binding with enum can be done in MVVM pattern. Here I assume that, you have basic idea of MVVM and how it can be used with WPF applications. The MVVM explaination is out of scope for this blog post.
First of all create simple WPF application named as EnumToDDLBinding using VS2010. You can give any name as per your choice. If so then make sure that, you replace the namespace names in codes mentioned below with your namespace name.  Add a new folder named as “ViewModel”. Add a new class in it named as “MainWindowViewModel.cs. The add another class in solution and name it as “MyEnum.cs”.
 The overall structure of solution is as shown below –
 
Add sample enum to MyEnum.cs as shown below –
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;