Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Help with Custom Control

 
 
Old 11-27-2006   #1 (permalink)
John Lorenzen


 
 

Help with Custom Control

I'm looking for some help with a custom control.

I have a control that I'm trying to create the control is composed of two
borders one on top of another, the bottom border background is a solid color
and the top border background is a linear gradient with a blur effect. I am
trying to create a dependency property so I can change the background color
of both borders at once. The problem is borders are not changing when I set
the property. Here is a simpler version of the code, basically when the set
method gets called I want the front border to be set to blue. Is there a
refresh I need to call or something?

public partial class UserControl1
{
public static DependencyProperty dpTabColor;

static UserControl1()
{
dpTabColor =
DependencyProperty.Register("TabColor",typeof(Brush),typeof(UserControl1));
}

public UserControl1()
{
this.InitializeComponent();
}

public Brush TabColor
{
get { return (Brush)base.GetValue(dpTabColor); }

set
{
base.SetValue(dpTabColor, value);
SolidColorBrush myBrush = new SolidColorBrush(Colors.Blue);
this.FrontBorder.Background = myBrush;
}
}

}



My System SpecsSystem Spec
 

Thread Tools



Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46