public MainWindowViewModel() { DisplayViewModel = new RelayCommand <ViewModelBase>(OnDisplayViewModel); BuildingRepository buildingRepository = new BuildingRepository(); BuildingTreeViewModel buildingViewModel = new BuildingTreeViewModel(buildingRepository.GetBuildingFromXMLFile("test")); Building = buildingViewModel; }