This question is locked. New answers and comments are not allowed.
I'd like to use the panel bar and have the SelectedItem property bound to a property in my data context (I'm using an MVVM pattern and the ViewModel will be the data context for the view).
The XAML is:
<nav:RadPanelBar Name="pbReportingMenu" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" > |
The code behind specifies the datacontext:
this.DataContext = new Menu_ViewModel(); |
And the Menu_ViewModel() class takes care of the property:
private RadPanelBar _selectedItem; |
public RadPanelBar SelectedItem |
{ |
get { return _selectedItem; } |
set |
{ |
_selectedItem = value; |
_OnPropertyChanged("SelectedItem"); |
} |
} |
When I add a breakpoint to my setter, it never gets hit. Any ideas?
(I have also tried using a dependency property, but this didn't work either)
public RadPanelBar SelectedItem |
{ |
get { return (RadPanelBar)GetValue(SelectedItemProperty); } |
set { SetValue(SelectedItemProperty, value); } |
} |
// Using a DependencyProperty as the backing store for SelectedItem. This enables animation, styling, binding, etc... |
public static readonly DependencyProperty SelectedItemProperty = |
DependencyProperty.Register("SelectedItem", typeof(RadPanelBar), typeof(Menu_ViewModel), new PropertyMetadata(null)); |
What types will the property be?
Does TwoWay binding work on the SelectedItem property?
Thanks,