public MouseHover()
        {
            InitializeComponent();
            Tag = AppResources.MouseHoverDescription;

            var data = new ObservableCollection <Customer>();

            for (int i = 0; i < ROW_COUNT; i++)
            {
                data.Add(new Customer(i));
            }
            var view = new MyCollectionView(data);

            using (view.DeferRefresh())
            {
                view.GroupDescriptions.Clear();
                view.GroupDescriptions.Add(new PropertyGroupDescription("Country"));
                view.GroupDescriptions.Add(new PropertyGroupDescription("Active"));
                var gd = view.GroupDescriptions[0] as PropertyGroupDescription;
                gd.Converter = new CountryInitialConverter();
            }

            // bind grids to ListCollectionView
            grid.ItemsSource = view;
        }
Exemplo n.º 2
0
        void BindITunesGrid()
        {
            var songs = MediaLibrary.Load();
            var view  = new MyCollectionView(songs);

            using (view.DeferRefresh())
            {
                view.GroupDescriptions.Clear();
                view.GroupDescriptions.Add(new PropertyGroupDescription("Artist"));
                view.GroupDescriptions.Add(new PropertyGroupDescription("Album"));
            }
            var fg = _flexiTunes;

            fg.CellFactory  = new MusicCellFactory();
            fg.MergeManager = null; // << review this, should not merge cells with content
            fg.Columns["Duration"].ValueConverter = new SongDurationConverter();
            fg.Columns["Size"].ValueConverter     = new SongSizeConverter();
            fg.ItemsSource = view;
        }
        void PopulateFinancialGrid()
        {
            _financialData = FinancialData.GetFinancialData();
            var view = new MyCollectionView(_financialData);

            _flexFinancial.ItemsSource              = view;
            _flexFinancial.Columns.Frozen           = 1;
            _flexFinancial.Columns[0].AllowDragging = false;

            // configure search box
            _srchCompanies.View = view;
            var props = _srchCompanies.FilterProperties;

            props.Add(typeof(FinancialData).GetProperty("Name"));
            props.Add(typeof(FinancialData).GetProperty("Symbol"));

            // show company info
            UpdateCompanyStatus();
            view.CollectionChanged += financial_CollectionChanged;

            UpdateCellFactory();
        }