This question is locked. New answers and comments are not allowed.
I am using your menu control to let users navigate, and I am using your tab control to show the views that they select. I do not want to close any tabs (views) automatically when they move between views, and I want to allow multiple instances of the same view, for example a product search, or a shopping cart.
so this is what I have roughed out: first the xaml
And to setup the tabcontrol
The first tab will hold the main landing page information (marketing stuff...)
So the question is how do I bind the tab to my view. The view name is in every case item.Name.ToString()+"View" so we could even create the name to bind to dynamically.
I assume I will need to initialize the view first.
I am doing all this using MVVM Light.
so this is what I have roughed out: first the xaml
<telerik:RadMenu x:Name="MainMenu" ClickToOpen="False" ItemClick="MainMenu_ItemClick" VerticalAlignment="Top" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="1" > <telerik:RadMenuItem Header="Manufacturers" > <telerik:RadMenuItem Header="List" Name="Manufacturers" > </telerik:RadMenuItem> <telerik:RadMenuItem Header="Detail" Name="Manufacturer" /> </telerik:RadMenuItem> <telerik:RadMenuItem Header="Customers"> <telerik:RadMenuItem Header="List" Name="Customers" /> <telerik:RadMenuItem Header="Detail" Name="Customer" /> </telerik:RadMenuItem> <telerik:RadMenuItem Header="Distributors" Name="Distributors"> </telerik:RadMenuItem> </telerik:RadMenu><telerik:RadTabControl FontSize="15" x:Name="tabControl" Margin="10" Grid.Row="1" Grid.Column="1" > <telerik:RadTabItem Header="Home" /> </telerik:RadTabControl>private void MainMenu_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e) { RadMenuItem item = e.OriginalSource as RadMenuItem; if (item != null) { RadTabItem itemToAdd = new RadTabItem() { Header = item.Name.ToString() // bind to view???? }; tabControl.Items.Add(itemToAdd); System.Windows.MessageBox.Show("You clicked '" + item.Header.ToString() + "'"+ item.Name.ToString()); } }So the question is how do I bind the tab to my view. The view name is in every case item.Name.ToString()+"View" so we could even create the name to bind to dynamically.
I assume I will need to initialize the view first.
I am doing all this using MVVM Light.