Hi
When working with WPF I always found myself thinking how to handle Data formatting when a WPF control was bound to it. Let’s look at the following example of a window with a TextBlock that displays a DateTime:
1: <Window x:Class="BindingFormat.Window1"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: Title="Window1" Height="300" Width="300">
5: <Grid>
6: <TextBlock Text="{Binding}"></TextBlock>
7: </Grid>
8: </Window>
This article was written by Alan Mendelevich
Hi
Recently I’ve been working on a set of custom WPF controls.
There are numerous good books and articles about WPF in general and some basic information on custom control development but I have yet to find a good article (or book) with in-depth coverage of custom control development in general and design-time related issues in particular.
Hey all.
Nothing new for this month so apart from reminding you that if you want to make a quick 30$ all you have to do is to drop us an good unique article (you can get more information on our Make Money Writing Articles Page). I will move on to the stats.
Here are March’s Stats:
Until a couple of years ago, most software applications were released in English. Unfortunately for us the developers, nowadays, many customers require that that the product they purchased, will be localized to a specific language (other than English). I know, for instance, that there is a European law which requires healthcare products to be localized to the European market (starting from 2009 or 2010). Because this article is about how to localize your application using string tables, I recommend you to first read about a free tool which helps you extract hard coded strings to string tables. Don’t go any further before you also read about how to generate public properties for string tables, you must read it.
Setting up a String Table
I assume that you already have some user interface which needs to be localized, I will demonstrate this process with…
Hi
In my previous post about WPF Binding Converters one of our readers (Thanks The Reddest) pointed our that a new converter instance is not created every time a call is made to the converter. I promised to test it again so here goes ![]()
I used the old converter code but added a static integer inside the converter to count the number of calls made to it. and then printed it out to the trace in the constructor.
In the previous month I have written an article about how to design a WPF custom context menu. I really liked that article because the outcome was very nice. Here comes the but :), as it turns out my implementation had a big disadvantage, it lacked the ability to show sub menus (an important trait in my opinion). So it was back to the drawing board for me.
After studying the WPF MenuItem Class and its Original Microsoft Template using blend. I learned some new things
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
We never published a lists of blog posts we liked, so this will be the first time. I gathered some links from my Google Reader shared items, some of those links are old, some are new, but I liked them all. So here is the list of 7 post/articles I recommend:
Usually, the WPF controls are declared in the .xaml file and not in the code behind (.xaml.cs file). However, we might need to use some of those controls in the code behind in order to manipulate them. How can we get the handle of such a control if it “resides” in the xaml file? Take a look at the following xaml code:
<Window x:Class="WpfApplication2.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" MouseLeftButtonDown="window_Clicked"> <Grid> <TextBlock x:Name="fullNameControl" FontSize="20" Text="{Binding Path=FullName}"> </TextBlock> </Grid> </Window>
There is a TextBlock called fullNameControl, in the code behind I change its background color to gold when the window is clicked:
Hi all
As you all remember in my article about Custom WPF Context Menu I mentioned that my WPF Binding Converter was a singleton, and I promised to tell you why, so here comes the 3 ways I know of using WPF Binding Converters. We will start from the worst (in my opinion) and move on the the best.
To start off here is the Binding Converter:
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More