• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CollectionView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CollectionView的典型用法代码示例。如果您正苦于以下问题:C# CollectionView类的具体用法?C# CollectionView怎么用?C# CollectionView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CollectionView类属于命名空间,在下文中一共展示了CollectionView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CanSort_Returns_False

        public void CanSort_Returns_False()
        {
            int[] source = new[] { 1, 1, 2, 3, 5, 8 };
            CollectionView target = new CollectionView(source);

            Assert.IsFalse(target.CanSort);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs


示例2: Culture_Is_Initially_Null

        public void Culture_Is_Initially_Null()
        {
            int[] source = new[] { 1, 1, 2, 3, 5, 8 };
            CollectionView target = new CollectionView(source);

            Assert.IsNull(target.Culture);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs


示例3: Initial_Items_Are_Same_As_SourceCollection

        public void Initial_Items_Are_Same_As_SourceCollection()
        {
            int[] source = new[] { 1, 1, 2, 3, 5, 8 };
            CollectionView target = new CollectionView(source);

            CollectionAssert.AreEqual(source, ((IEnumerable)target).Cast<object>().ToArray());
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs


示例4: CanFilter_Returns_True

        public void CanFilter_Returns_True()
        {
            int[] source = new[] { 1, 1, 2, 3, 5, 8 };
            CollectionView target = new CollectionView(source);

            Assert.IsTrue(target.CanFilter);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs


示例5: SourceCollection_Is_Set

        public void SourceCollection_Is_Set()
        {
            int[] source = new[] { 1, 1, 2, 3, 5, 8 };
            CollectionView target = new CollectionView(source);

            Assert.AreSame(source, target.SourceCollection);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs


示例6: ResGroupEditor

		public ResGroupEditor(IEditorEnvironment editorEnvironment, ICommandHistory history)
		{
			this.editorEnvironment = editorEnvironment;
			this.history = history;
			this.AutoSize = true;
			this.Padding = new Padding(10);

			this.SuspendLayout();

			this.split = new SplitContainer { Dock = DockStyle.Fill };
			this.split.Panel2Collapsed = true;
			this.Controls.Add(this.split);

			var sp = new StackPanel { Dock = DockStyle.Fill, AutoSize = true };
			this.split.Panel1.Controls.Add(sp);

			var collectionView = new CollectionView<IResourceFile>(a => editorEnvironment.EditorFor(a, history))
				{ AutoSize = true };
			collectionView.ItemsPanel.AutoSize = true;
			collectionView.ItemsPanel.AutoScroll = false;
			new PropertyBinding<ResGroup, IList<IResourceFile>>(collectionView, this.dataContext, m => m.ExternalResources, null);
			sp.Controls.Add(collectionView);

			var embCollectionView = new CollectionView<Managed>(a => this.CreateButtonForResource(a)) { AutoSize = true };
			embCollectionView.ItemsPanel.AutoSize = true;
			embCollectionView.ItemsPanel.AutoScroll = false;
			new PropertyBinding<ResGroup, IList<Managed>>(embCollectionView, this.dataContext, m => m.EmbeddedResources, null);
			sp.Controls.Add(embCollectionView);

			this.ResumeLayout();
			this.PerformLayout();
		}
开发者ID:gleblebedev,项目名称:toe,代码行数:32,代码来源:ResGroupEditor.cs


示例7: CreateGenerator

    internal static CustomItemContainerGenerator CreateGenerator( DataGridControl parentGridControl, CollectionView collectionView, DataGridContext dataGridContext )
    {
      CustomItemContainerGenerator newGenerator = new CustomItemContainerGenerator( collectionView, dataGridContext, parentGridControl );
      dataGridContext.SetGenerator( newGenerator );

      return newGenerator;
    }
开发者ID:wangws556,项目名称:duoduo-chat,代码行数:7,代码来源:CustomItemContainerGenerator.cs


示例8: CustomListbox

        public CustomListbox(ref CollectionView iBindableView)
        {
            InitializeComponent();

            pBindableView = iBindableView;
            OnPropertyChanged("dataView");
        }
开发者ID:nomoreclowns,项目名称:ES_xmlGuiEditor,代码行数:7,代码来源:CustomListbox.xaml.cs


示例9: ConnectionViewModel

 public ConnectionViewModel(string name)
 {
     _name = name;
     IList<PhoneBookEntry> list = new List<PhoneBookEntry>
                                  {
                                      new PhoneBookEntry("test"),
                                      new PhoneBookEntry("test2")
                                  };
     _phonebookEntries = new CollectionView(list);
 }
开发者ID:vivekhegde,项目名称:IntelliCode,代码行数:10,代码来源:Fullstack.xaml.cs


示例10: AddGrouping

 private void AddGrouping(object sender, RoutedEventArgs e)
 {
     _myView = (CollectionView) CollectionViewSource.GetDefaultView(myItemsControl.ItemsSource);
     if (_myView.CanGroup)
     {
         var groupDescription
             = new PropertyGroupDescription("@Type");
         _myView.GroupDescriptions.Add(groupDescription);
     }
 }
开发者ID:ClemensT,项目名称:WPF-Samples,代码行数:10,代码来源:MainWindow.cs


示例11: LogViewModel

        public LogViewModel()
        {
            MessagesLock = new Object();
            messages = new ObservableCollection<LogMessageModel>();

            BindingOperations.EnableCollectionSynchronization(messages, MessagesLock);
            //clearLog = new Command(new Action(() => messages.Clear()));

            LogLevel = new CollectionView(Enum.GetValues(typeof(LogMessageModel.LogLevel)));
            LogLevel.MoveCurrentTo(LogMessageModel.LogLevel.INFO);
        }
开发者ID:iejeecee,项目名称:mediaviewer,代码行数:11,代码来源:LogViewModel.cs


示例12: ToolkitType

        /// <summary>
        /// Initializes a new instance of the <see cref="ToolkitType"/> class.
        /// </summary>
        public ToolkitType()
        {
            var componentModel = ServiceProvider.GlobalProvider.GetService<SComponentModel, IComponentModel>();
            var export = componentModel.GetService<IEnumerable<IInstalledToolkitInfo>>();
            this.allToolkits = new ObservableCollection<IInstalledToolkitInfo>((export != null) ? export.ToList() : new List<IInstalledToolkitInfo>());
            this.toolkitsView = new ListCollectionView(this.allToolkits);

            InitializeComponent();

            FilterToolkits();
        }
开发者ID:NuPattern,项目名称:NuPattern,代码行数:14,代码来源:ToolkitType.xaml.cs


示例13: MainWindowViewModel

        public MainWindowViewModel()
        {
            Properties.Settings.Default.LastLogReadedDate = DateTime.Now;
            IsAutostart = Properties.Settings.Default.Autostart;
            MailStateButtonName = "Active Mail Service";
            AvailableDriveLetters = new CollectionView(GetAvailableDrives());

            _alarmTimer = new DispatcherTimer();
            _alarmTimer.Tick += new EventHandler(SendMailTick);
            _alarmTimer.Interval = TimeSpan.FromMinutes(Properties.Settings.Default.AlarmIntervalInMinutes);
        }
开发者ID:aortmannm,项目名称:WatchDog,代码行数:11,代码来源:MainWindowViewModel.cs


示例14: MainWindowViewModel

        public MainWindowViewModel(Window window)
        {
            this.CurrentWindow = window;
            this._allStudents = DBHandler.Instance.QueryAll();
            this._filteredStudents = new StudentCollection();

            this.Students = this._allStudents;

            IList<SearchConditionEntry> searchConditionList = new List<SearchConditionEntry>();
            searchConditionList.Add(new SearchConditionEntry("姓名", SearchCategory.SearchByName));
            searchConditionList.Add(new SearchConditionEntry("身份证", SearchCategory.SearchByIdentity));
            this._searchConditions = new CollectionView(searchConditionList);
            this._searchKeyword = "";
        }
开发者ID:wanghan,项目名称:DriveSchool,代码行数:14,代码来源:MainWindowViewModel.cs


示例15: CurrencyManager

    public CurrencyManager( DataGridContext dataGridContext, CollectionView collectionView )
    {
      if( dataGridContext == null )
        throw new ArgumentNullException( "dataGridContext" );

      if( collectionView == null )
        throw new ArgumentNullException( "collectionView" );

      m_dataGridContext = dataGridContext;
      m_collectionView = collectionView;

      System.Diagnostics.Debug.Assert( m_dataGridContext.CurrentItem == m_collectionView.CurrentItem );

      this.RegisterListeners();
    }
开发者ID:Torion,项目名称:WpfExToolkit,代码行数:15,代码来源:CurrencyManager.cs


示例16: ButtonMappingEntryControl

        public ButtonMappingEntryControl()
        {
            ButtonProfile = new DsButtonProfile();

            InitializeComponent();

            CurrentCommandTypeView = new CollectionView(AvailableCommandTypes);
            CurrentCommandTargetView = new CollectionView(AvailableKeys);

            CurrentCommandTypeView.MoveCurrentTo(AvailableCommandTypes.First());
            CurrentCommandTargetView.MoveCurrentTo(AvailableKeys.First());

            CurrentCommandTypeView.CurrentChanged += CurrentCommandTypeOnCurrentChanged;
            CurrentCommandTargetView.CurrentChanged += CurrentCommandTargetOnCurrentChanged;
        }
开发者ID:CheesyKek,项目名称:ScpToolkit,代码行数:15,代码来源:ButtonMappingEntryControl.xaml.cs


示例17: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            panel.DataContext = staff;
            staff.Add(new Staff {
                FileName = "atm.jpg",
                FullName = "Arne Tolstrup Madsen",
                Initials = "atm"
            });
            staff.Add(new Staff {
                FileName = "tk.jpg",
                FullName = "Torben Krøjmand",
                Initials = "tk"
            });
            staff.Add(new Staff {
                FileName = "kr.jpg",
                FullName = "Karsten Rasmussen",
                Initials = "kr"
            });
            staff.Add(new Staff {
                FileName = "haso.jpg",
                FullName = "Hanne Sommer",
                Initials = "haso"
            });
            staff.Add(new Staff {
                FileName = "gs.jpg",
                FullName = "Gert Simonsen",
                Initials = "gs"
            });
            view = (CollectionView)CollectionViewSource.GetDefaultView(staff);

            // set biding for tBoxHeight
            Binding binding = new Binding();
            binding.Path = new PropertyPath("FullName");
            binding.Mode = BindingMode.OneWay;
            lbl.SetBinding(Label.ContentProperty, binding);

            binding = new Binding();
            binding.Path = new PropertyPath("Initials");
            binding.Mode = BindingMode.TwoWay;
            txbox.SetBinding(TextBox.TextProperty, binding);

            binding = new Binding();
            binding.Path = new PropertyPath("FileName");
            binding.Mode = BindingMode.OneWay;
            binding.Converter = new FileNameConverter();
            img.SetBinding(Image.SourceProperty, binding);
        }
开发者ID:KasperFlye,项目名称:CsharpAndDotNet,代码行数:48,代码来源:MainWindow.xaml.cs


示例18: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            // Preparing some fake data
            List<Person> people = new List<Person>
                                      {
                                          new Person {FirstName="Agnes", Age=30, FavoriteColor = "Black"},
                                          new Person {FirstName = "Janne", Age=22, FavoriteColor = "Magenta"},
                                          new Person {FirstName = "Roy", Age=23, FavoriteColor = "Aquamarine"},
                                          new Person {FirstName = "Kimmel", Age=32, FavoriteColor = "Green"},
                                          new Person {FirstName ="Manuel", Age=20, FavoriteColor = "Blue"}
                                      };
            listPeople.ItemsSource = people;
            peopleCollectionView = CollectionViewSource.GetDefaultView(listPeople.ItemsSource) as CollectionView;
        }
开发者ID:Vintharas,项目名称:Test-projects,代码行数:16,代码来源:MainWindow.xaml.cs


示例19: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            // Preparing some fake data
            List<Person> people = new List<Person>
                                      {
                                          new Person {FirstName="Agnes", Age=30, FavoriteColor = "Black", Gender="F"},
                                          new Person {FirstName = "Janne", Age=22, FavoriteColor = "Black", Gender="M"},
                                          new Person {FirstName = "Roy", Age=23, FavoriteColor = "Aquamarine", Gender="M"},
                                          new Person {FirstName = "Kimmel", Age=32, FavoriteColor = "Green", Gender="M"},
                                          new Person {FirstName ="Manuela", Age=20, FavoriteColor = "Green", Gender="F"}
                                      };
            listPeople.ItemsSource = people;
            peopleCollectionView = CollectionViewSource.GetDefaultView(listPeople.ItemsSource) as CollectionView;
            peopleCollectionView.GroupDescriptions.Add(new PropertyGroupDescription(propertyName: "Gender"));
            peopleCollectionView.GroupDescriptions.Add(new PropertyGroupDescription(propertyName: "FavoriteColor"));
        }
开发者ID:Vintharas,项目名称:Test-projects,代码行数:18,代码来源:MainWindow.xaml.cs


示例20: MessageListViewModel

        private MessageHeaderViewModel selectedMessageHeaderViewModel; // This could be null.

        #endregion Fields

        #region Constructors

        public MessageListViewModel()
        {
            LoadMessages();
            messageManager.NewMessageArrived += OnNewMessageArrived;
            messageManager.MessageAdded += OnMessageAdded;
            messageManager.MessageRemoved += OnMessageRemoved;

            MessageContentViewPopupRequest = new InteractionRequest<MessageContentViewNotification>();
            OpenMessageContentViewCommand = new DelegateCommand(RaiseMessageContentViewPopupRequest);
            DeleteMessageCommand = new DelegateCommand(RaiseDeleteMessagesEvent);
            this.messagesCv = (CollectionView)CollectionViewSource.GetDefaultView(MessageHeaderViewModels);
            this.messagesCv.SortDescriptions.Add(new SortDescription("Date", ListSortDirection.Descending));
            SelectedMessageHeaderViewModels = new List<MessageHeaderViewModel>();

            HandleMailboxSelectionChange(null);

            GlobalEventAggregator.Instance.GetEvent<MailboxSelectionEvent>().Subscribe(HandleMailboxSelectionChange, ThreadOption.UIThread);
            GlobalEventAggregator.Instance.GetEvent<DeleteMessagesEvent>().Subscribe(HandleDeleteMessagesEvent, ThreadOption.UIThread);
        }
开发者ID:uml-dc2-2016-spring,项目名称:dc16-MEClient,代码行数:25,代码来源:MessageListViewModel.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Collections类代码示例发布时间:2022-05-24
下一篇:
C# CollectionNamespace类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap