Jul
17th | 2008

WPF Binding Converter Best Practices

Posted by Amit |
Filed under WPF |

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:


Continue Reading...
Jun
13th | 2008

Why Should You Use The x:key Attribute In WPF DataTemplates

Posted by Amit |
Filed under .Net, WPF |

We have all used WPF DataTemplates, but I bet most of you never gave thought to the meaning of the x:Key attribute. We all know the meaning of the DataType attribute, which determines to what type of data the template will apply to. But what about the x:Key why is it there? Lets tale a look at the following code:

<Window.Resources>
        <DataTemplate DataType=”{x:Type data:s}”>
            <Button Width=”50″ Height=”50″>
                <TextBlock Text=”{Binding text}”></TextBlock>
            </Button>
        </DataTemplate>
    </Window.Resources>
    <Canvas>
        <ItemsControl ItemsSource=”{Binding}”>
        </ItemsControl>
    </Canvas>


Continue Reading...
Jun
5th | 2008

The Use of Environment.NewLine In a WPF MultiLine TextBox

Posted by Amit |
Filed under .Net, WPF |

Last week I was in the need to use a WPF TextBox that had multi line capabilities. I started Typing Multi and hit CTRL + Space to get the intelisense and I was shocked! No MultiLine TextBox, I did get the following:

But no MultiLine TextBox

   1: <MultiBinding></MultiBinding>
   2: <MultiBindingExpression></MultiBindingExpression>
   3: <MultiDataTrigger></MultiDataTrigger>
   4: <MultiTrigger></MultiTrigger>


Continue Reading...
May
28th | 2008

Convert Your Vector Graphics Image to WPF/Silverlight Code

Posted by Shahar Y |
Filed under .Net, WPF, Web Development |

SVG (Scalable Vector Graphics) is an open W3C standard for graphics file format and Web development language based on XML. Those image are made up of lines, curves and other “smooth” elements so when you zoom in on a SVG it stays smooth (unlike GIF, JPEG, PNG). 

Imagine you can draw some of your user interface elements in a vector drawing application like: Adobe,   InkScape (free) or Skencil (free) and convert your work into WPF XAML or Silverlight XAML. ViewerSVG  (SVG to xaml converter) is your tool.

image


Continue Reading...
May
27th | 2008

How to Create a WPF Two Level Master-Detail Application With ComboBoxes

Posted by Shahar A |
Filed under C#, WPF |

Master-Detail is a pattern for displaying details of a specific item selected from a list of items. In this post I’ll demonstrate how to use master-detail in WPF with two levels of objects, each displayed in a ComboBox and Data Binding to tie them together.


Continue Reading...
May
23rd | 2008

WPF Property Grid

Posted by Shahar Y |
Filed under .Net, Utilities, WPF |

We all know the propertyGrid control, which provides a user interface for browsing the properties of an object. What about having a WPF propertyGrid? Well, yesterday I  noticed that there is a work in progress on an open source WPF property grid. Tomer Shamam announced in his blog Essential WPF that he accepted Microsoft Israel OPEN UP challenge (open source contest) and created a new project - WPF property grid. As he stated, it is currently only a Proof of concept and the interface and its usage may change in next releases. I think that its worth tracking…


Continue Reading...
May
23rd | 2008

XHTML Sitemap Validation Tool 1.1 Version Released

Posted by Shahar Y |
Filed under .Net, Misc., Utilities, WPF |
imageXHTML sitemap validation tool allows you to XHTML validate your entire sitemap in one click, unlike the W3C markup validation service that let you validate one page at a time. This tool is also needed because XHTML validation is very important in the manner of SEO.
 
After releasing it a few days ago, Rob White from http://www.jacquelinewhite.co.uk/ wrote us that he had problems validating his site. Checking that issue, we found out that the default namespace on Robs sitemap is different than what we expected. During this bug fix, some other issues came up and we decided to release version 1.1 of our tool. The update includes:


Continue Reading...
May
20th | 2008

Validate Your Entire Web Site With This Free Open Source WPF XHTML Validation Tool

Posted by Amit |
Filed under .Net, WPF |

XHTML Validation Tool During the past couple of weeks we noticed that whenever we tweak our theme or change something in one of our posts, it causes some pages to become XHTML invalid. We came to think that you never know where it is going to hit you, so we sat down and created a small application which helps you keep all your pages XHTML valid. We checked it on our sitemap, and seems we have some HTML work to do :).

This application is written in WPF and is based on the .Net Framework 3.5.

It will allow you to validate you entire sitemap in one click. The validation is done through the W3C validation SOAP service, so you can trust it :).


Continue Reading...
May
14th | 2008

How To Add a MouseDoubleClick Event To Any WPF Control

Posted by Amit |
Filed under .Net, WPF |

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:

  1. the first thought i had was to create a User Control that held only a grid and implement the MouseDoubleClick on the User Control itself so what you will get is this Xaml code:
  2. <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>
    Since the Grid takes the…


    Continue Reading...
Apr
23rd | 2008

WPF DataTemplate for Interfaces? Not Supported

Posted by Shahar Y |
Filed under .Net, WPF |

DataTemplates are a great feature introduced in WPF, it allows to determine how data is presented and how data binding accesses the presented data. Just as we can apply a visual style to a specific UI control, we can do it for a specific data type. There is just one problem here, DataTemplates are good [...]


Continue Reading...

Search Dev102