Parametrized BooleanToVisibilityConverter

Windows Presentation Foundation allows us to create our own value converters and use them in XAML bindings. WPF also comes with a set of predefined converters. One of them is BooleanToVisibilityConverter. It this post I will show you how to create own version of this converter with parameter feature supported. BoleanToVisibilityConverter sets the Visibility value to Visible whe…

By Mirek on (tags: BooleanToVisibilityConverter, IValueConverter, WPF, categories: code)

Gradient generator for WPF

Have you ever straggled with generating and polishing gradient for wpf in xaml? I did many times. Did you use any tool for that, except Visual Studio Property tab? I didn’t. Until I stumble upon Online Gradient Maker. I thought the Visual Studio designer and editor is all you need to create rich WPF apps, until I had to create a style for radio button with circular gradient on …

By Mirek on (tags: gradient, WPF, XAML, categories: tools)

Because empty tags are bad

Well, not always, but there are times when they are so…what can I do to avoid them. Up to asp.net mvc 3 there’s a problem – if I want to render something wrapped in let’s say a paragraph, but I don’t want that paragraph to appear if the content is empty, then the markup looks like this: That’s a bit verbose. If I skip that check, then an empty hole is rendered on the page so ag…

By on (tags: mvc, categories: code)

Custom WPF check box with inner shadow effect.

Today I will show you how to override the CheckBox control template to style it in custom way and add a sexy looking shadow effect. We want to replace the standard windows checkbox look with something cooler and fit to our application design Windows Presentation Foundation controls are based on Styles and templates. When you want to change the look of the control you have to st…

By Mirek on (tags: CheckBox, inner shadow, styling, WPF, categories: code)