/// <summary> /// Changes the selected tile. /// </summary> /// <param name="msg">Message containing the selected item.</param> private void ChangeSelectedTile(Message.M_ChangeSelectedTile msg) { // Only change the selectedtile if a project tile has been selected // do nothing and keep the previously selected tile if an application tile has been selected if (msg.SelectedProject != null) { SelectedTile = msg.SelectedProject; if (SelectedTile != null) { if (SelectedTile.SubItems.Any() | SelectedTile.Associations.Any()) { // Change the breadcrumb (title bar) to reflect the newly selected item PopulateBreadCrumb(SelectedTile, msg.ResetBreadcrumb); } } } }
private void TileClicked(Message.M_ChangeSelectedTile msg) { // Try to cast the item as a Project Project project = msg.SelectedProject as Project; if (project != null) { if (project.SubItems.Any()) { // Reset the active tile collection and add all subitems of the selected tile ActiveTileCollection = new ObservableCollection <SwitcherItem>(project.SubItems); } SelectedTile = project; GetAssociatedApplications(); } else { // Selected tile must be an application. Send a message to the main view model containing the selected application Messenger.Default.Send(new GenericMessage <TopApplication>(this, msg.SelectedApplication)); } }