public GroupsPageViewModel() { // Get raw group tree data from a database Group[] rootGroups = FakeDataService.GetGroupsTree(); // Create UI-friendly wrappers around the raw data objects(i.e. the view-model). _groupsTreeViewModel = new GroupsTreeViewModel(rootGroups); }
public UserDetailPage(UserViewModel userViewModel) { InitializeComponent(); if (userViewModel != null) { _userViewModel = userViewModel.Clone(); _originalUserModel = userViewModel; Title = "User Details"; _userNameTbx.IsEnabled = false; } else { _userViewModel = new UserViewModel(); Title = "Add User"; } DataContext = _userViewModel; _groupsTreeViewModel = new GroupsTreeViewModel(FakeDataService.GetGroupsTree()); _candidateGroupsTree.DataContext = _groupsTreeViewModel; membershipListBox.SelectionChanged += membershipListBox_SelectionChanged; membershipListBox.Loaded += membershipListBox_Loaded; CommandBindings.Add(new CommandBinding(NavigationCommands.BrowseHome, GoHomeExecuted, CommandCanExecute)); CommandBindings.Add(new CommandBinding(NavigationCommands.BrowseBack, GoHomeExecuted, CommandCanExecute)); }
public SearchFamilyTreeCommand(GroupsTreeViewModel groupsTreeViewModel) { _groupsTreeViewModel = groupsTreeViewModel; }