![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |