at least could anybody implement the following two classes using MEF and I will follow up for rest of the sample
public class CountryViewModel
{
readonly ReadOnlyCollection<RegionViewModel> _regions;
public ReadOnlyCollection<RegionViewModel> Regions
{
get { return _regions; }
}
//---------------------------------------------------------
public CountryViewModel(Region[] regions)
{
_regions = new ReadOnlyCollection<RegionViewModel>(
(from region in regions
select new RegionViewModel(region))
.ToList());
}
}
public class RegionViewModel : TreeViewItemViewModel
{
readonly Region _region;
public RegionViewModel(Region region)
: base(null, true)
{
_region = region;
}
public string RegionName
{
get { return _region.RegionName; }
}
protected override void LoadChildren()
{
foreach (State state in Database.GetStates(_region))
base.Children.Add(new StateViewModel(state, this));
}
}