Many times I want to make my WPF Controls have a 3D effect. For examples Headers of lists and such. Saddly there is no built in way to do it so we have to come up with a custom solution. I don’t want to use Bitmap effects due to performance reasons, I must say I don’t have much experience with them but from what I have I am not a big fan.
Here is my solution for a 3D effect on WPF Controls.
First of all a Quick demonstration. Which one looks better.
I don’t know about you but the second one is much nicer with that 3D effect.
How is it done? As I said before I don’t like using Bitmap effects if I don’t have to, so this is done with combining 2 borders together. The simple upper one is a regular border with TextBlock
How would you like your WPF application to have a Context Menu like this:
Well, It is not so hard. Here is how you do it:
Last week I was faced with a problem. I needed to implement a MouseDoubleClick Event on a WPF Grid. I said Ha, easy but as i went on to implement it i realized that the Grid has no MouseDoubleClick Event! So how am I supposed to implement it? I came up with 2 solutions and so here goes:
<UserControl x:Class="CustomDoubleClick.GridWrapper" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <Grid> </Grid> </UserControl>
Yesterday I played around with WPF resources and stumbled on a very strange behavior. It seems that the order of the elements in the resources have some importance as to how the application handles them. A few code examples are attached
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More