当前位置: 首页>>代码示例>>C#>>正文


C# ListCollectionView.MoveCurrentToPosition方法代码示例

本文整理汇总了C#中System.Windows.Data.ListCollectionView.MoveCurrentToPosition方法的典型用法代码示例。如果您正苦于以下问题:C# ListCollectionView.MoveCurrentToPosition方法的具体用法?C# ListCollectionView.MoveCurrentToPosition怎么用?C# ListCollectionView.MoveCurrentToPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Data.ListCollectionView的用法示例。


在下文中一共展示了ListCollectionView.MoveCurrentToPosition方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeCarParentDialog

        public ChangeCarParentDialog(CarObject car) {
            InitializeComponent();
            DataContext = this;

            Buttons = new[] {
                OkButton, 
                CreateExtraDialogButton(ControlsStrings.CarParent_MakeIndependent, () => {
                    Car.ParentId = null;
                    Close();
                }),
                CancelButton
            };

            Car = car;
            Filter = car.Brand == null ? "" : @"brand:" + car.Brand;

            CarsListView = new ListCollectionView(CarsManager.Instance.LoadedOnly.Where(x => x.ParentId == null && x.Id != Car.Id).ToList()) {
                CustomSort = this
            };

            UpdateFilter();
            if (car.Parent == null) {
                CarsListView.MoveCurrentToPosition(0);
            } else {
                CarsListView.MoveCurrentTo(car.Parent);
            }

            Closing += CarParentEditor_Closing;
        }
开发者ID:gro-ove,项目名称:actools,代码行数:29,代码来源:ChangeCarParentDialog.xaml.cs

示例2: CustomerListModel

 public CustomerListModel(List<Customer> data)
 {
     _data = data;
     _customers = (ListCollectionView) CollectionViewSource.GetDefaultView(_data);
     _customers.Filter = FilterCustomers;
     _customers.CurrentChanged += CustomerChanged;
     _customers.CustomSort = new CustomerSorter();
     _customers.MoveCurrentToPosition(-1);
 }
开发者ID:dmacuk,项目名称:HillStationPOS,代码行数:9,代码来源:CustomerListModel.cs

示例3: AccountTransactionViewModel

 public AccountTransactionViewModel(IFileProcessorFactory processorFactory, IViewThreadExecutor viewThreadExecutor, IDataService dataService, IAccTransactionValidator validator)
 {
     var processorTable = processorFactory.ProcessorNames.ToDictionary(x => x, x => processorFactory.GetFileProcessor(x));
     var details = processorFactory
         .ProcessorNames
         .Select(x =>
         {
             var fileProcessor = processorFactory.GetFileProcessor(x);
             var allFileDetails = fileProcessor.GetAllFileNames()
             .Select(fileName => new FileDetailViewModel(fileName, dataService, viewThreadExecutor, fileProcessor, validator))
             .ToArray();
             return new ProcessorDetails(x, allFileDetails);
         }).ToList();
     ProcessorDetails = new ListCollectionView(details);
     if(details.Count > 0)
         ProcessorDetails.MoveCurrentToPosition(0);
 }
开发者ID:MohanGurusamy,项目名称:AccountTransactionProcessor,代码行数:17,代码来源:AccountTransactionViewModel.cs

示例4: GetSitesView

 public static ListCollectionView GetSitesView(OnlineVideosMainWindow window, string preselectedSiteName = null)
 {
     int? indexToSelect = null;
     List<Site> convertedSites = new List<Site>();
     int i = 0;
     foreach (var s in OnlineVideos.OnlineVideoSettings.Instance.SiteUtilsList.Values)
     {
         if (preselectedSiteName != null && s.Settings.Name == preselectedSiteName) indexToSelect = i;
         convertedSites.Add(new Site(s));
         i++;
     }
     ListCollectionView view = new ListCollectionView(convertedSites)
     {
         Filter = new Predicate<object>(s => ((ViewModels.Site)s).Name.ToLower().Contains(window.CurrentFilter)),
     };
     if (indexToSelect != null) view.MoveCurrentToPosition(indexToSelect.Value);
     return view;
 }
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:18,代码来源:Site.cs

示例5: WorkspaceViewModel

        /// <summary>
        /// Create a new instance of <see cref="WorkspaceViewModel"/>
        /// </summary>
        public WorkspaceViewModel()
        {

            ToggleControl = new DelegateCommand<UIElement>(this.OnToggleControl);

            AddWorkspaceCommand = new DelegateCommand<TextBox>(
               this.OnAddWorkspaceCommand);

            RemoveWorkspaceCommand = new DelegateCommand(
                this.OnRemoveWorkspaceCommand);

            OpenWorkspace = new DelegateCommand(
                this.OnOpenWorkspace);

            ObservableCollection<WorkspaceModel> data = new ObservableCollection<WorkspaceModel>(
              service.Load());

            CurrentWorkspaces = new ListCollectionView(
                data);

            CurrentWorkspaces.MoveCurrentToPosition(-1);
            CurrentWorkspaces.CurrentChanged += CurrentWorkspaces_CurrentChanged;

        }
开发者ID:yurivital,项目名称:lucy,代码行数:27,代码来源:WorkspaceViewModel.cs

示例6: GetCategoriesView

 public static ListCollectionView GetCategoriesView(OnlineVideosMainWindow window, IList<OnlineVideos.Category> categories, string preselectedCategoryName = null)
 {
     int? indexToSelect = null;
     List<Category> convertedCategories = new List<Category>();
     int i = 0;
     if (categories != null)
     {
         foreach (var c in categories)
         {
             if (preselectedCategoryName != null && c.Name == preselectedCategoryName) indexToSelect = i;
             convertedCategories.Add(new Category(c));
             i++;
         }
     }
     ListCollectionView view = new ListCollectionView(convertedCategories)
     {
         Filter = new Predicate<object>(cat => (((Category)cat).Name ?? "").ToLower().Contains(window.CurrentFilter))
     };
     if (indexToSelect != null) view.MoveCurrentToPosition(indexToSelect.Value);
     return view;
 }
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:21,代码来源:Category.cs


注:本文中的System.Windows.Data.ListCollectionView.MoveCurrentToPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。