WPF
2 09 2013
Sometimes its necessary to change the mousecursor of an application to show the user that something goes on. Most times we just want to show the wainting-cursor as long as an operation takes and switch then back. The first problem you’ll encouter, is exception-handling. You need to put everything into a try-finally-block to get your […]
cursor, IDisposible, OverrideCursor, singleton, using
19 06 2013
There is an interesting thing about the RichTextControl most people don’t know. The Flow-Document used to store the content of a RichTextBox can handle controls. Which means you can put controls in your text and let the user interact. Maybe you want to let the user choose between different options with a checkbox or show […]
Controls, IsDocumentEnabled, RichTextBox, WPF
15 06 2013
If you have ever used the WPF-RichTextBox you know this strang behavior when you press enter. Instead of a single row, the cursor jumps two. You can press shift + enter instead and get just a single row. But don’t try to tell this your customers. There is an easy and elegant way to change […]
Enter, RichTextBox, WPF
20 04 2013
When you want to use an image as brush, you have to decide where to put it. Best and easiest way is to include it as resource to your project. Simply add to picture to your project (maybe in an subfolder called images) and change “build action” to resource, if its not already set. To […]
brush, imagebrush, Snippet
12 03 2013
Modern applications use animations to create nice effects and shorten waiting times. In a pie-chart its also used to show the difference between values or for presentations. To create such an effect we’ll again reuse the Pie-Class i created earlier and add the shadow effect to it. With WPF its very easy to generate different […]
animation, Shape, WPF
10 03 2013
As always you will find alot of crapp about shadows in WPF on the internet. And again, here is a HowTo to show you an easy way to do it. To demonstrate the shadow we’ll use the Pie-Code from my last Post. Now we’ll just set the shadow effect for one of the pies. As […]
DropShadowEffect, effect, shadow, WPF
8 03 2013
It is very easy to extend controls in WPF, but only with code behind you can do the real cool stuff. When you search the internet for code to draw a part of a circle, you will get alot of crappy code. Some try to do it with XAML-Code but can’t calculate the needed values […]
custom control, PieChart, Shape, WPF
4 03 2013
Since WPF and especially Windows 8 its obligatory to build responsive UIs. This means, the UI is always responding to an user-request even if a long taking request is made. An easy way to achieve this is a background worker, which is nothing more then an extra thread which can work with the UI-Thread. If […]
backgroundworker, DataGrid, responsive UIs, thread, WPF
13 02 2013
It may seem simple to generate a squared control, but it isn’t. At least when the control should work with different screen resolution and window sizes. Thats a must have for any WPF-Control. In the old Windows-Forms days we would have listened to a resize-event on the height or width-property and told the otherone the […]
C#, CustomControl, Game, WPF