tags:

views:

62

answers:

2

What I have?

I have Frame in XAML, (binding works properly).

<Frame Name="frmMainContent"
             DataContext="MyPageInformation"
             Source="{Binding ElementName=thisPage, Path=MyPageInformation.UserControlPath}"
             NavigationUIVisibility="Hidden"></Frame>

In the code behind I have a DependencyProperty of my class, PageInformation

public static DependencyProperty PageInformationProperty = DependencyProperty.Register("MyPageInformation", typeof(PageInformation), typeof(Administration));

    public PageInformation MyPageInformation
    {
        get { retur n (PageInformation)GetValue(PageInformationProperty); }
        set{ SetValue(PageInformationProperty, value); }
    }

What I want?

The Frame should update its binding whenever value of MyPageInformation changes.

Can somebody tell me how I can achieve this?

Thanks in advance!

A: 

Well, the first thing I'll tell you is that all binding errors appear on the Output window. So you need to look at it and find out if you have any errors.

The next thing.. for bindings to update automatically, you either need to make the property it is "binded" to, either a dependency property, or implement INotifyPropertyChanged for other classes.

Be sure that the property that you exactly bind to, is either one of these cases.

Trainee4Life
+1  A: 

You don't have to make the PageInformationProperty a dependency property just for this binding. Implement INotifyPropertyChanged in the code behind.

Also since you are actually binding to "UserControlPath", make sure that this property actually sends change notifications.

Trainee4Life