Пример #1
0
        public MainWindow()
        {
            InitializeComponent();

            timer.Tick += TimerTick;
            timer.Interval = new TimeSpan(0,0,2);

            CloseCommand = new RelayCommand(_ => Close());

            CreateData();

            DataContext = this;
        }
Пример #2
0
        public FilterControlViewModel(ICollectionView cv)
        {
            view = cv;

            AddFilterCommand = new RelayCommand(_ => AddAdvancedFilter());
            RemoveFilterCommand = new RelayCommand(RemoveAdvancedFilter, CanRemoveAdvancedFilter);

            SimpleFilter = new TextFilter();

            advanced_filter = new AggregateFilter();
            AdvancedFilterViewModels = new ObservableCollection<FilterViewModel>();

            UpdateFilter();
        }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;

            #region MasterData generation
            Node root = new Node("Root");
            root.Nodes.Add(new Node("Level 1 - item 1"));
            root.Nodes.Add(new Node("Level 1 - item 2"));
            root.Nodes.Add(new Node("Level 1 - item 3"));
            root.Nodes.Add(new Node("Level 1 - item 4"));
            root.Nodes.Add(new Node("Level 1 - item 5"));

            Node d = root.Nodes.Skip(1).First();
            d.Nodes.Add(new Node("Level 2 - item 1"));
            d.Nodes.Add(new Node("Level 2 - item 2"));
            d.Nodes.Add(new Node("Level 2 - item 3"));
            d.Nodes.Add(new Node("Level 2 - item 4"));

            d = d.Nodes.Skip(2).First();
            d.Nodes.Add(new Node("Level 3 - item 1"));
            d.Nodes.Add(new Node("Level 3 - item 2"));
            d.Nodes.Add(new Node("Level 3 - item 3"));
            #endregion

            #region Themes generation
            themes = new List<string> { "ExpressionDark", "ExpressionLight", "ShinyBlue", "ShinyRed" };
            CurrentTheme = themes.First();
            #endregion

            NavigateToBreadCrumbCommand = new RelayCommand(NavigateToBreadCrumb);
            DrillDownCommand = new RelayCommand(DrillDown, CanDrillDown);
            ChangeThemeCommand = new RelayCommand(ChangeTheme);

            StartNodeCommand = new RelayCommand(StartNode, _ => BreadCrumbs.Count > 1);
            BackNodeCommand = new RelayCommand(BackNode, _ => BreadCrumbs.Count > 1);

            BreadCrumbs = new ObservableCollection<Node>();
            BreadCrumbs.CollectionChanged += BreadCrumbsCollectionChanged;
            BreadCrumbs.Add(root);
        }
Пример #4
0
        public MainWindow()
        {
            InitializeComponent();

            #region DataGrid Data

            MasterData = new ObservableCollection<Data>();
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(1), "Item 1", 1.5));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(2), "Item 2", 2.2));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(3), "Item 3", 3.3));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(4), "Item 4", 4.4));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(5), "Item 5", 5.5));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(1), "Item 1", 1.4));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(2), "Item 2", 2.2));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(3), "Item 3", 3.3));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(4), "Item 4", 4.4));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(5), "Item 5", 5.5));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(1), "Item 1", 1.3));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(2), "Item 2", 2.2));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(3), "Item 3", 3.3));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(4), "Item 4", 4.4));
            MasterData.Add(new Data(DateTime.Now.Date.AddMonths(5), "Item 5", 5.5));

            for (int i = 0; i < 1000; i++)
                MasterData.Add(new Data(DateTime.Now.Date.AddMonths(6), "Item " + (100 + i), 42.0));

            #endregion

            var view = CollectionViewSource.GetDefaultView(MasterData) as ListCollectionView;
            aggregate_comparer = new AggregateComparer(view);

            Sorters = new ObservableCollection<Sorter>();

            SortCommand = new RelayCommand(Sort);

            DataContext = this;
        }