Tutorials - C#, WPF, ASP.NET MVC, WCF, Entity Framework, AngularJS and MVVM Frameworks - MVVM Light - DotNetPattern.com
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:
63. What is the difference between Send and Post methods in SynchronizationContext class?
81. What is Property-based Animation in WPF?
WPF introduces a property-based animation techniques to make animations in WPF easy.
It simply modify the value of control property over an interval of time and the target property must be a dependency property.
82. How many types of Animation support by WPF?
There are baiscally three types of Animation classes.
Label control is used for showing the text data in the WPF application. It also provides support for Access Keys.
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.
WPF Listview is a control that is used for display a list of data items. It inherits directly from ListBox. Listview provides an ItemsSource property for binding list of items. Below is the sample program for binding listview items.
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.
WPF ListView is a very popular tool for showing list of items. Sometimes we need to hide the ListView column headers and only show the list of items.
But ListView does not provide any default behavior or property for hiding the column headers.
By applying a simple style you can hide the column headers of WPF ListView.
WPF provides various templates for customization of controls. WPF ListView ItemTemplate is in one of these. ItemTemplate of ListView is useful when we have to change the visual presentation of bound data objects.
If your WPF ListView control is bound to collection of objects using ItemsSource proeprty and you have not set the ItemTemplate property, then it will call the...
WPF ListView ItemTemplateSelector is used for choosing a DataTemplate for each ListViewItem at runtime. You can provide a custom logic to choose which DataTemplate to use in list view item.
When to use?
You have to show different UIs for each ListViewItem based on some condition. But using the ItemTemplate you can only set only one DataTemplate which is used by every List...
Today writing large WPF application is very complex task. WPF application composed of many complex UI designs, larget set of business objects, data storage objects and presentation logic which makes the development of WPF application quite cumbersome.
Microsoft introduced a new pattern "MVVM" to make the development of WPF application easier.
MVVM is an arc...
A very common requirement in TabControl is to show a close button (X) near the end of header of each TabItem.
We can use ItemTemplate to customize the header section and show a close button (X) at the end of TabItem header.
Close Button Example