Suppose you have several objects in your WPF application filled with similar Brushes which differ in brightness only. Like in this image:

red_rect

 

The nine rectangles use the same RadialGradienBrush but each rectangle is a little darker than previous. You can create these 9 different brushes in your favorite design tool (Expression Blend, etc.). But what if you need to change the base color later or you just need to make the brush user-configurable? Like in these samples:


Continue Reading...

This article was written by Alan Mendelevich

The Problem

Creating a shape with bullets on the joints of it’s segments sounds like a really trivial task at a first glance. Just plaster some bullets on top of the shape. And it is really something like this until you decide you want to have transparent outlined bullets or opaque bullets with transparent outline around them. Like the ones in this picture:

bulleted_path_samples

 


Continue Reading...

Hi

 

While working on a complex UI application in WPF I noticed that because I was using DataTemplates both the Xaml and the Code Behind got very messy, that is because if you need to implement some events in the code behind you basically “mix” code from the template and code from the Window, plus you cannot access the elements in the template from the code behind.

Let’s look at the following example:


Continue Reading...

Hi

 

Yesterday I was trying to create a control with a partially transparent background,. I am writing this because what I thought was so straight forward, was not.

Here is a simple example:

   1: <Grid>
   2:    <Button Height="23" Margin="94,103,109,0" Name="button1" 
   3:            VerticalAlignment="Top">Button</Button>
   4:    <Border Margin="57,61,21,101" Name="border1" 
   5:            Background="blue" />
   6: </Grid>

When we run this example we will get the following:


Continue Reading...

Hi

 

I was working on a Silverlight Application lately and I was in the need to open up a Popup window. and I am not talking about the regular .NET Message box. Naturally I Created a Page with some controls created a new instance of it but Saddly there was no Page.Show() method :( .

 

I know you can use the Popup Control to do a similar job (although I am not sure about the fade in and out) but I just played around and I liked what came out of it, so here is my solution to this problem.

 


Continue Reading...