Category Archives: WPF

WPF issues and solutions

Hacking the WPF DataGrid: properly hiding rows for unwanted items

If you even need to hide some DataGridRow elements displayed in a WPF DataGrid please remember these few things – it took me some time to realize and solve them all: If you plan to just set DataGridRow.Visibility to Collapsed … Continue reading

Posted in WPF | Tagged , , , , , | Leave a comment

Generically handling multi-threading exceptions in WPF

You have a WPF app and you just want to show a message whenever an exception is raised an not handled anywhere else in code. The first try is surely this: This works fine, as long as the exception isn’t … Continue reading

Posted in .NET, C#, WPF | Tagged , , , | Leave a comment

ToolTipService.ShowDuration within a specific WPF view

ToolTipService.ShowDuration attached property isn’t inherited from parent to child elements within the WPF visual tree, and therefore values for this property – to produce runtime effects – must be set on all the elements that have ToolTips for which we’d … Continue reading

Posted in WPF | Tagged , , ,

Attached properties and the WPF DataGrid

WPF attached properties. They look like such a difficult topic. But you only need to see a single example in action to understand their true potential: as long as your objects inherit from DependencyObject you can add as many extra … Continue reading

Posted in WPF | Tagged , , , , | Leave a comment

DataGridComboBoxColumn.ItemsSource binding issue

The code below doesn’t work as one would expect, i.e. to allow selecting one value for each item in the DataGrid using ComboBoxes in a secondary column, even if if there is an AvailableValues property in the Window container class … Continue reading

Posted in WPF | Tagged , , , | Leave a comment

XAML element properties and cut-paste refactoring

As you know, to set properties for WPF objects in XAML, one uses either attributes or elements, like the Text and LayoutTransform properties of the TextBox element below, respectively: <Border> <TextBlock Text=”Hello!”> <TextBlock.LayoutTransform> <ScaleTransform ScaleY=”2″/> </TextBlock.LayoutTransform> </TextBlock> </Border> Using elements is required when … Continue reading

Posted in WPF | Tagged , , , , , , | Leave a comment

Want to learn WPF? Get a book

Originally posted on Sorin Dolha's Blog:
I’ve said it before. In my opinion, WPF is the single contemporary programming technology (disclaimer: among those that I’ve considered myself) that really requires a book to learn it. Otherwise, trying to dig…

Posted in WPF | Tagged , , | Leave a comment

Workaround for FrameworkElement.Triggers using Style and resolving issue

Many times it would be so handy to have Triggers available at the root FrameworkElement object type. Yes, the property exists, but it only supports EventTrigger at that level, while many times you’d want a different type of trigger, such … Continue reading

Posted in WPF | Tagged , , , , | 4 Comments

Good to know: Windows SmartScreen certificate reputation

Assume that you have developed a full-trust Windows desktop application (such as based on WPF) and deployed it using ClickOnce some time ago. Of course, to ensure people trust your application upon downloading or running it, you signed its manifests using … Continue reading

Posted in .NET, WPF | Tagged , , , , , | Leave a comment

Hyperlinks in standard WPF windows

You can add Hyperlink elements in WPF documents and navigational containers. However, fi you have a standard WPF window, how do you do it? Here is a possible solution: add a TextBlock with a Hyperlink inside it every time needed, and optionally … Continue reading

Posted in WPF | Tagged , , | Leave a comment