The main reason to create DependencyProperty is when you write you own WPF control.
The main difference is, that the value of a normal .NET property is read directly from a private member in your class, whereas the value of a DependencyProperty is resolved dynamically when calling the GetValue() method that is inherited from DependencyObject. Continue reading →
You can put all the controls in one panel (Grid, StackPanel, etc.), and leave the cancel button(I don’t want to disable) in another panel. Then set the IsEnabled property of the other panel. Continue reading →
In this tip, we will talk about how to pass a CommandParameter for a Button control which is used within theItemTemplate of the ListBox control. We are trying to load the list of Buttons inside the ListBox. The list of Buttons is in English and Danish language. This tip will help you to identify which Button has been pressed and how to pass the CommandParameter within the Button control in MVVM. Continue reading →
Often times in Xaml you’ve got some labels, or buttons that you don’t want to show if something in the ViewModel is null or empty. Take the example below. The ViewModel has a nullable property rating. If it is non-null a handful of controls are rendered to show it graphically and numerically. If it is null however we don’t want to see any of that stuff. This converter helps hide elements of something in the ViewModel is null or empty string. Continue reading →