I am trying to choose the best way to implement this interface in MVVM. I am new to WPF (e.g. 2 months), but I have vast experience with WinForms.

The ListBox here acts like a TabControl (so it switches the view to the right) and basically contains the type of item displayed in the tables. The entire user interface is dynamic (ListBox, TabItems, and columns are defined at runtime). The application is designed for WPF and Silverlight.
Classes required for ViewModel:
public abstract class ViewModel : INotifyPropertyChanged {}
public abstract class ContainerViewModel : ViewModel
{
public IList<ViewModel> Workspaces {get;set;}
public ViewModel ActiveWorkspace {get;set;}
}
public class ListViewModel<TItem> where TItem : class
{
public IList<TItem> ItemList { get; set; }
public TItem ActiveItem { get; set; }
public IList<TItem> SelectedItems { get; set; }
}
public class TableViewModel<TItem> : ListViewModel<TItem> where TItem : class
{
public Ilist<ColumnDescription> ColumnList { get; set; }
}
Now the question is how to relate this to the View.
There are two basic approaches that I see here:
- With XAML: due to the lack of Generics support in XAML, I will lose strong typing.
- Without XAML: I can reuse the same
ListView<T> : UserControl.
, , 3 ( XAML ). DataBinding DataGrid TabControl TabItems, , , :
: 28.02.2011
, TreeView ListBox, . , , TreeView.SelectedItems - readonly, . Ummm , - , viewmodel. , DisplayMemberPath TreeView ( , ToString()). ViewModel.SelectedItem TreeView:
private void UpdateTreeViewSelectedItem()
{
}
, , ...
, Control Library Hell MVVM: http://cid-b73623db14413608.office.live.com/self.aspx/.Public/MVVMDemo.zip