I have a tab control in hierarchy
xaml:
<telerikNavigation:RadTabItem IsEnabled="{Binding Loaded}" Loaded="RadTabItem_Loaded" Margin="10,0,0,0" Height="24" FontWeight="Bold" FontSize="11" Foreground="Black" Background="Gray"> |
<telerikNavigation:RadTabItem.Header> |
<TextBlock Text="Linked titles" /> |
</telerikNavigation:RadTabItem.Header> |
c#:
private void RadTabItem_Loaded(object sender, RoutedEventArgs e) |
{ |
RadTabItem tab = (RadTabItem)sender; |
if (!itemSpecs.ContainsKey(hier_selectedId.ToString())) |
{ |
itemSpecs[hier_selectedId.ToString()] = new linnworks.cloud.dataModel.Inventory.StockItemClass(); |
} |
tab.DataContext = itemSpecs[hier_selectedId.ToString()]; |
} |
itemSpecs[id].Loaded = false;
Then later in code I'm changing this to itemSpecs[id].Loaded=true (it binding with isEnabled)
itemSpecs is ObservableDictionary and it implements INotifyCollectionChanged, INotifyPropertyChanged
But I stil need to close and then again expand grid to enable this tab.
Is there any way to get the tabItem by name in hierarchy so I could change isEnabled property in code.
Thanks.