private void CommandBindingToButton_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            FrameworkElement itemsControl = DataContext as FrameworkElement;

            if (itemsControl != null)
            {
                Breadcrumb parent = VisualTreHelperEx.FindVisualParent <Breadcrumb>(this);
                object     target = itemsControl.DataContext;
                if (target == null)
                {
                    target = itemsControl;
                }
                parent.GoTo(target);
            }
        }
Exemple #2
0
        private void CommandBindingToMenuItem_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var breadcrumb = VisualTreHelperEx.FindVisualParent <Breadcrumb>(this);

            breadcrumb.AddTrail(ParentItem, e.Parameter);
        }