![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Problem with a DP PropertyChangedCallback not being invoked Hi all, I was wondering if someone could take a quick look at this sample. I have a custom control, which has a single dependency property. When you set this dependency property in XAML upon declaration of the control, I need to set some properties on the child elements of this control (specifically it's a child grid which has it's Visibility property changed). I've set up a PropertyChangedCallback on this property to make the change to the corresponding internal properties when the DP is set. Here are the relevant snippets: // the custom control class definition: public partial class DataGrid : ItemsControl { // Dependency Properties public static readonly DependencyProperty ShowRowHeadersProperty = DependencyProperty.Register("ShowRowHeaders", typeof(bool), typeof(DataGrid), new PropertyMetadata( new PropertyChangedCallback(ShowRowHeadersPropChanged))); .... public static void ShowRowHeadersPropChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { Console.WriteLine("In ShowRowHeadersPropChanged()"); bool value = (bool) e.NewValue; ((DataGrid) d).rowHeaderGrid.Visibility = value ? Visibility.Visible : Visibility.Hidden; } and the XAML that creates the DataGrid in a window: <cc ataGrid Grid.Row="1" x:Name="OrderGrid" ShowRowHeaders="False" />For some reason, the ShowRowHeadersPropChanged callback in never invoke when I run this code. I've tried this exact same other pattern in another example to test it and the callback does get invoked. Can any MS folks have an idea on why the Callback might not be invoked? Thanks, any help is appreciated! Jason |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Powershell starts but never exits when invoked from Wscript shell | kanjasaha | PowerShell | 7 | 05-12-2008 12:14 PM |
| PS script behavior when invoked from cmd.exe | Doug | PowerShell | 0 | 03-15-2007 11:17 AM |
| Tracebacks from code invoked via a Runspace | Jason Mobarak | PowerShell | 0 | 03-02-2007 04:36 PM |
| move-mailbox cmdlet problem when invoked in c# code. | =?Utf-8?B?UGFydGg=?= | PowerShell | 2 | 08-31-2006 11:43 PM |