Normally when a storyboard is running, setting the FillBehavior (Learn more about FillBehavior) to HoldEnd is risk. Because for a dependency property, storyboard is considered to have highest priority of setting the value. So once storyboard is done, user cannot change its value locally. So users prefer the set the FillBehavior to Stop and change the target... Continue Reading →
Touch and Hold Gesture – Awaitable
Touch and Hold gesture can not be identified using any built-in API. Surface SDKs may provide one. But I will show a simple awaitable way to detect this gesture. Using a timer, we can wait for a particular seconds and return the method once the timer elapsed. If user took his hand before timer elapsed, then... Continue Reading →
Visual Tree Helpers
WPF User Interface is represented in a way of tree. There are two ways that the complete object tree is conceptualised and can be reported to its public API: as the logical tree and as the visual tree. The Logical tree does not contain the core controls of WPF. For example, the child object of a ContentControl... Continue Reading →
InvokeCommandAction with EventArgs as Command Parameter
Expression Blend team provides the ability to wire up some events to viewmodel through commands like SelectionChanged of a ListBox, etc using System.Windows.Interactivity.dll. You can bind a Command to any event with WPF controls. There is also a way to bind command parameter also, so that view state can passed to the viewmodel. Custom Command... Continue Reading →
Attached Properties VS Behaviors
One of the powerful concept of WPF is Attached Properties. The primary purpose of attached property is to define a unique value to child elements for a property, which is defined in Parent element as MSDN suggests. Some of the typical examples are Grid.Row, DockPanel.Dock, etc. But it can also be used to attach additional... Continue Reading →
Attached Properties VS Behaviors
One of the powerful concept of WPF is Attached Properties. The primary purpose of attached property is to define a unique value to child elements for a property, which is defined in Parent element as MSDN suggests. Some of the typical examples are Grid.Row, DockPanel.Dock, etc.But it can also be used to attach additional information... Continue Reading →
5 Tricks you should know in WPF – PART 2
1. TextBlock is not just for Text We all know that TextBlock is an UI control, which will carry a piece of text. But actually MSDN explains it in a bit different way. Provides a lightweight control for displaying small amounts of flow content. Flow Content !!!, which not means only text. Lets look at... Continue Reading →
5 Tricks you should know in WPF – PART 2
1. TextBlock is not just for TextWe all know that TextBlock is an UI control, which will carry a piece of text. But actually MSDN explains it in a bit different way.Provides a lightweight control for displaying small amounts of flow content.Flow Content !!!, which not means only text. Let's look at the power of... Continue Reading →