/// <summary> /// Converts the BreadCrumbItems /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void OnBreadcrumbConvertItem(object sender, BreadcrumbConvertItemEventArgs e) { if (_isloaded) { if (breadcrumb.SelectedItem is BreadCrumbViewModel) { SelectedItems.Insert(0, breadcrumb.SelectedItem); return; } ConvertItemHelper.ItemTitle = ((WorkspaceItem)(breadcrumb.SelectedItem)).ItemTitle; e.Path = ConvertItemHelper.ItemTitle; return; } if (Vm.Treeviewitem != null) { if ((Vm.Treeviewitem.Header is WorkspaceItem) && (Vm.Treeviewitem.Header as WorkspaceItem).ItemImage.Length == 0) { (Vm.Treeviewitem.Header as WorkspaceItem).ItemImage = GetLocalItemImageForBreadCrumb(); } ConvertItemHelper.Treeviewitem = Vm.Treeviewitem; // ConvertItemHelper.HandleConvertItem(sender, e); } UpdateSelectedItems(); ConvertItemHelper.GetTrail(breadcrumb.RootItem, breadcrumb.SelectedItem); ConvertItemHelper.HandleConvertItem(sender, e); #region "need to check" //Loads dynamically the child item for the selected breadcrumb menu item //if (e.Item.GetType().Name == Constants.WorkspaceItem) //{ // if (((WorkspaceItem)e.Item).Children != null) // { // foreach (var item in ((WorkspaceItem)e.Item).Children) // { // if (item.Children != null) // foreach (var childitem in item.Children) // { // if (childitem.Children == null || childitem.Children.Length == 0) // { // ChildItem.Add(childitem); // //Vm.EventBroker.RaiseGetChild(new LoadWorkspaceItemEventArgs // //{ // // WorkspaceId = childitem.Id, // // ItemId = childitem.ItemId // //}); // } // } // } // ConvertItemHelper.ChildItem = ChildItem; // } // } #endregion }
/// <summary> /// Occurs when the element is loaded /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">A <see cref="RoutedEventArgs"/> that contains the event data.</param> private void OnLoaded(object sender, RoutedEventArgs e) { this.favoriteItems.BeginUpdate(); try { this.favoriteItems.Clear(); object rootItem = this.breadcrumb.RootItem; this.favoriteItems.Add(ConvertItemHelper.GetItem(rootItem, "Desktop\\Control Panel\\Security")); this.favoriteItems.Add(ConvertItemHelper.GetItem(rootItem, "Desktop\\Recycle Bin")); this.favoriteItems.Add(ConvertItemHelper.GetItem(rootItem, "Desktop\\Computer\\Local Disk (C:)\\Temp")); } finally { this.favoriteItems.EndUpdate(); } }
/// <summary> /// Handles the SelectedItemChanged event of the breadcrumb control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="PropertyChangedRoutedEventArgs{object}"/> instance containing the event data.</param> private void OnBreadcrumbSelectedItemChanged(object sender, ObjectPropertyChangedRoutedEventArgs e) { if (this.synchronizingSelection) { return; } this.synchronizingSelection = true; try { UpdateComboBoxItems(); // We will get the trail to the item selected in the Breadcrumb and use that to select the item in the TreeView IList trail = ConvertItemHelper.GetTrail(this.breadcrumb.RootItem, this.breadcrumb.SelectedItem); if (null != trail && 0 != trail.Count) { SelectItem(this.treeView, trail, 0); } } finally { this.synchronizingSelection = false; } }
///////////////////////////////////////////////////////////////////////////////////////////////////// // NON-PUBLIC PROCEDURES ///////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Handles the ConvertItem event of the breadcrumb control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ActiproSoftware.Windows.Controls.Navigation.BreadcrumbConvertItemEventArgs"/> instance containing the event data.</param> private void OnBreadcrumbConvertItem(object sender, BreadcrumbConvertItemEventArgs e) { ConvertItemHelper.HandleConvertItem(sender, e); }