Пример #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.filterTextBox = ((System.Windows.Controls.TextBox)(target));

            #line 28 "..\..\..\..\Dom\ClassBrowser\OpenFromGacDialog.xaml"
                this.filterTextBox.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.FilterTextBox_TextChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.listView = ((System.Windows.Controls.ListView)(target));

            #line 30 "..\..\..\..\Dom\ClassBrowser\OpenFromGacDialog.xaml"
                this.listView.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ListView_SelectionChanged);

            #line default
            #line hidden

            #line 30 "..\..\..\..\Dom\ClassBrowser\OpenFromGacDialog.xaml"
                this.listView.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.ListView_MouseDoubleClick);

            #line default
            #line hidden
                return;

            case 3:
                this.nameColumn = ((ICSharpCode.Core.Presentation.SortableGridViewColumn)(target));
                return;

            case 4:
                this.okButton = ((System.Windows.Controls.Button)(target));

            #line 42 "..\..\..\..\Dom\ClassBrowser\OpenFromGacDialog.xaml"
                this.okButton.Click += new System.Windows.RoutedEventHandler(this.OKButton_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.gacReadingProgressBar = ((System.Windows.Controls.ProgressBar)(target));
                return;
            }
            this._contentLoaded = true;
        }
        static void OnSortDirectionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            ListView grid = sender as ListView;

            if (grid != null)
            {
                SortableGridViewColumn col = GetCurrentSortColumn(grid);
                if (col != null)
                {
                    col.SortDirection = (ColumnSortDirection)args.NewValue;
                }
                Sort(grid);
            }
        }
        static void OnCurrentSortColumnChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            ListView grid = sender as ListView;

            if (grid != null)
            {
                SortableGridViewColumn oldColumn = (SortableGridViewColumn)args.OldValue;
                if (oldColumn != null)
                {
                    oldColumn.SortDirection = ColumnSortDirection.None;
                }
                SortableGridViewColumn newColumn = (SortableGridViewColumn)args.NewValue;
                if (newColumn != null)
                {
                    newColumn.SortDirection = GetSortDirection(grid);
                }
                Sort(grid);
            }
        }
        static void Sort(ListView grid)
        {
            ColumnSortDirection    currentDirection = GetSortDirection(grid);
            SortableGridViewColumn column           = GetCurrentSortColumn(grid);

            if (column != null && GetSortMode(grid) == ListViewSortMode.Automatic && currentDirection != ColumnSortDirection.None)
            {
                ICollectionView dataView = CollectionViewSource.GetDefaultView(grid.ItemsSource);

                string sortBy = column.SortBy;
                if (sortBy == null)
                {
                    Binding binding = column.DisplayMemberBinding as Binding;
                    if (binding != null && binding.Path != null)
                    {
                        sortBy = binding.Path.Path;
                    }
                }

                dataView.SortDescriptions.Clear();
                if (sortBy != null)
                {
                    ListSortDirection direction;
                    if (currentDirection == ColumnSortDirection.Descending)
                    {
                        direction = ListSortDirection.Descending;
                    }
                    else
                    {
                        direction = ListSortDirection.Ascending;
                    }
                    dataView.SortDescriptions.Add(new SortDescription(sortBy, direction));
                }
                dataView.Refresh();
            }
        }
 public static void SetCurrentSortColumn(ListView listView, SortableGridViewColumn value)
 {
     listView.SetValue(CurrentSortColumnProperty, value);
 }
Пример #6
0
		public static void SetCurrentSortColumn(ListView listView, SortableGridViewColumn value)
		{
			listView.SetValue(CurrentSortColumnProperty, value);
		}
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.upgradeDescription = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 2:
     this.listView = ((System.Windows.Controls.ListView)(target));
     
     #line 31 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
     this.listView.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ListView_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 3:
     this.nameColumn = ((ICSharpCode.Core.Presentation.SortableGridViewColumn)(target));
     return;
     case 4:
     this.selectAllCheckBox = ((System.Windows.Controls.CheckBox)(target));
     
     #line 59 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
     this.selectAllCheckBox.Checked += new System.Windows.RoutedEventHandler(this.SelectAllCheckBox_Checked);
     
     #line default
     #line hidden
     
     #line 60 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
     this.selectAllCheckBox.Unchecked += new System.Windows.RoutedEventHandler(this.SelectAllCheckBox_Unchecked);
     
     #line default
     #line hidden
     return;
     case 5:
     this.conversionGroupBox = ((System.Windows.Controls.GroupBox)(target));
     return;
     case 6:
     this.newVersionComboBox = ((System.Windows.Controls.ComboBox)(target));
     
     #line 95 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
     this.newVersionComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.newVersionComboBox_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 7:
     this.newFrameworkComboBox = ((System.Windows.Controls.ComboBox)(target));
     
     #line 110 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
     this.newFrameworkComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.newFrameworkComboBox_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 8:
     this.convertButton = ((System.Windows.Controls.Button)(target));
     
     #line 119 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
     this.convertButton.Click += new System.Windows.RoutedEventHandler(this.convertButton_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
Пример #8
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.upgradeDescription = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 2:
                this.listView = ((System.Windows.Controls.ListView)(target));

            #line 31 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
                this.listView.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ListView_SelectionChanged);

            #line default
            #line hidden
                return;

            case 3:
                this.nameColumn = ((ICSharpCode.Core.Presentation.SortableGridViewColumn)(target));
                return;

            case 4:
                this.selectAllCheckBox = ((System.Windows.Controls.CheckBox)(target));

            #line 59 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
                this.selectAllCheckBox.Checked += new System.Windows.RoutedEventHandler(this.SelectAllCheckBox_Checked);

            #line default
            #line hidden

            #line 60 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
                this.selectAllCheckBox.Unchecked += new System.Windows.RoutedEventHandler(this.SelectAllCheckBox_Unchecked);

            #line default
            #line hidden
                return;

            case 5:
                this.conversionGroupBox = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 6:
                this.newVersionComboBox = ((System.Windows.Controls.ComboBox)(target));

            #line 95 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
                this.newVersionComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.newVersionComboBox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 7:
                this.newFrameworkComboBox = ((System.Windows.Controls.ComboBox)(target));

            #line 110 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
                this.newFrameworkComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.newFrameworkComboBox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.convertButton = ((System.Windows.Controls.Button)(target));

            #line 119 "..\..\..\..\..\Src\Project\Converter\UpgradeView.xaml"
                this.convertButton.Click += new System.Windows.RoutedEventHandler(this.convertButton_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }