Subscribe:

Pages

Thursday, November 24, 2011

Check whether Instance of window class file already created in current assembly

     In this post I tried to show a detail idea about how to execute exactly on instance to your window class. Then you can prevent open a window more than one.

1. Import Library file into your class


2. Get Currently running assembly file. This is a executable file in your project.


3. Get already created instance in your windows application


4. If your window class file not created instance in your project then you can create the instance to your window class.

Monday, November 7, 2011

Control ComboBox ItemSource using another ComboBox in DataGrid

In this post I try to show a detail Idea about how to control the data source in DataGrid ComboBox using another DataGrid ComboBox.

1. I add two resource keys into Data Grid. First resource key help to bind a datasource in ItemType ComboBox and second one help to bind a datasource in ItemName ComboBox according to ItemType ComboBox.


2. In the first data template column I try to bind the enum class as data source in my Item Type ComboBox.
 

3. In the second data template column in DataGrid bind a static resource as its item source.
 
This SetValueInBook class return the ItemSource in ComboBox.


4.  I create the Items type List to set the data source into ComboBox.

 

5. The ItemSourceof Item Name ComboBox,  changed when the selection changed of my Item Type ComboBox. You can set the data source into List item source.