Tags

Start with MVVM Light Toolkit

MVVM Light toolkit is a lightweight toolkit for MVVM. This toolkit provides very basic classes for developing your application in MVVM architecture. You can download the latest MVVM Light Toolkit from here. MVVM Light Toolkit comes with 2 main DLLs. GalaSoft.MvvmLight.dll GalaSoft.MvvmLight.Extras.dll Main classes in GalaSoft.MvvmLight.dll are: ObservableObject - Bas...

Continue Reading

MVVM Light Messenger

MVVM Light Messenger is a class that allows exchange messages between objects. Messenger class is mainly used for sending messages between viewmodels. Messenger class decreases coupling between viewmodels. Every viewmodel can communicate with another viewmodel without any association between them. Messenger is an implementation of Mediator pattern in MVVM Light toolkit. You can know more a...

Continue Reading

5 minutes Guide of WPF ListView ItemTemplate

ListView control in WPF is used for display a list of items. Every list view item has its own UI for display its own data. But how every listview item is rendered, it's depend on the ItemTemplate property of ListView. ItemTemplate property is used for get and set the DataTemplate of every list view item. DataTemplate defines how each item appears. You defines a single DataTemplate in the It...

Continue Reading

How to Hide WPF ListView Columns in MVVM?

ListView control is a very popular control among WPF developers. Developers use ListView control for showing the data in tabular format. Sometimes, we need to hide WPF ListView columns, but wpf does not provide any default implementation for hide WPF ListView columns. I have developed a WPF Behavior to hide WPF ListView columns through Attach property. An attached property named HideColumns is...

Continue Reading

Quick Tips to Filter ListView in WPF

WPF ListView does not support Filtering by default. ListView does not have their own methods to filter the bounded list. But WPF has a very special class CollectionViewSource which supports Filtering very effectively and in very easy way. What is CollectionViewSource class? CollectionViewSource is a class which we can use in WPF for filtering and sorting a bounded list. This class ex...

Continue Reading

WPF BackgroundWorker

To build more responsive WPF UI, we have to use multiple threads that can work in the background and update the UI when the work completed. But background threads can't access the objects created in the STA. Then how can we update the UI when the background threads completed their work? WPF applications are based on Single Threaded Apartment Model (STA). Objects created in the STA are not ...

Continue Reading

WPF ListView - GridView, Bindings, ItemTemplate Examples

WPF ListView comes under 10 most important controls in WPF. ListView represents a control in WPF which display a collection of data items. ListView is capable of showing data items in different views. It comes with its default view GridView which show items in tabular format. WPF ListView contains almost same features as ListBox as it is inherit from ListBox control. In this post, I am showing...

Continue Reading

WPF Label Control - Guide and Examples

Label control is used for showing the text data in the WPF application. It also provides support for Access Keys. <Label /> Content Property Label is directly inherit from ContentControl class which provides the Content property to Label control. In the Content property, you can set the string or host any type of child control. <StackPanel Margin="10"> <Lab...

Continue Reading

WPF Interview Questions for Beginners & Advanced - Part 2

21. How can we find resources from ResourceDictionary and apply on controls? ResourceDictionary stored resources as key value pairs and you have a method called FindResource in every control to find the resource from the ResourceDictionary. Every resource is stored as reference type so you have to cast the object to the original type. btn1.Background = (Brush)btn1.FindResource("backgro...

Continue Reading

WPF Interview Questions for Beginners & Advanced - Part 4

61. How can you obtain the SynchronizationContext class? You can use the static property SynchronizationContext.Current property from the UI thread. 62. How many methods are available in SynchronizationContext class? There are two methods: Post Send 63. What is the difference between Send and Post methods in SynchronizationContext class? Post method is asynchronous me...

Continue Reading