Example #1
0
        protected override DependencyObject GetContainerForItemOverride()
        {
            TreeListViewRow container         = new TreeListViewRow();
            Binding         isSelectedBinding = new Binding("IsSelected");

            isSelectedBinding.Mode = BindingMode.TwoWay;
            BindingOperations.SetBinding(container, TreeListViewRow.IsSelectedProperty, isSelectedBinding);
            return(container);
        }
Example #2
0
        internal new void ScrollIntoView(object item)
        {
            if (item == null)
            {
                return;
            }

            SelectedItem = item;
            base.ScrollIntoView(item, ColumnFromDisplayIndex(0));

            Dispatcher.BeginInvoke(new Action(delegate
            {
                while (SelectedItem == null)
                {
                    SelectedItem = item;
                }

                TreeListViewRow tlItem = ItemContainerGenerator.ContainerFromIndex(SelectedIndex) as TreeListViewRow;
                tlItem.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
            }));
        }