Exemplo n.º 1
0
        public MainPageViewModel(IMainPage view)
        {
            this.view = view;

            var bounds = ApplicationView.GetForCurrentView().VisibleBounds;

            var scaleFactor = 1.0; // DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;

            this.bounds = new Size(bounds.Width * scaleFactor, bounds.Height * scaleFactor);

            SheetViewModel       = new SheetViewModel(this, view);
            TableViewModel       = new TableViewModel(this, view);
            ExplorationViewModel = new ExplorationViewModel(this, view);
            FilterViewModel      = new FilterViewModel(this, view);
            SelectionViewModel   = new SelectionViewModel(this, view);
            Const.Initialize();
        }
Exemplo n.º 2
0
        public void Initialize(Sheet sheet)
        {
            this.Sheet = sheet;

            PageHeight         = Bounds.Height / 2 - 4;// Bounds.Height;
            QuarterHeight      = Bounds.Height / 4;
            NegativePageHeight = -PageHeight;
            PageOffset         = PageHeight + 8;
            TableWidth         = Bounds.Width * 4.5 / 10;
            PageWidth          = Bounds.Width * 4.5 / 10;
            ParagraphWidth     = PageWidth - 40;

            PageHeaderHeight = 0; // 110;

            ParagraphTitleHeight    = 90;
            PageLabelCarouselHeight = 50;

            PageFooterHeight = 0; // 110;

            ParagraphHeight      = PageHeight - PageHeaderHeight - PageLabelCarouselHeight - PageFooterHeight - 8;
            ParagraphChartHeight = ParagraphHeight - ParagraphTitleHeight;

            // rowViewModels 계산

            sheetViewModel.Initialize(sheet);

            // 가이드라인 및 헤더 컬럼 추가
            tableViewModel.Initialize();

            explorationViewModel.Initialize();

            filterViewModel.Initialize();

            selectionViewModel.Initialize();

            // 메타데이터 초기화
            ExplorationViewModel.MetadataViewModel.Initialize();

            return;

            var dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;

            ExplorationViewModel.PreviewColumn(SheetViewModel.ColumnViewModels[2]);

            DispatcherTimer dispatcherTimer = new DispatcherTimer();

            dispatcherTimer.Tick += (sender, e) =>
            {
                dispatcherTimer.Stop();

                ExplorationViewModel.TopPageView.ViewModel.State = PageViewModel.PageViewState.Selected;
                ExplorationViewModel.PageViewStateChanged(ExplorationViewModel.TopPageView.ViewModel, ExplorationViewModel.TopPageView);

                //PageView topPageView = ExplorationViewModel.SelectedPageViews.Last();
                //topPageView.SelectionChanged(null, sheetViewModel.FilteredRows.Where((r, index) => index < 50).ToList(), SelectionChangedType.Add, ReflectReason.ChartSelection);

                ExplorationViewModel.PreviewColumn(SheetViewModel.ColumnViewModels[1]);

                DispatcherTimer dispatcherTimer2 = new DispatcherTimer();
                dispatcherTimer2.Tick += (sender2, e2) =>
                {
                    dispatcherTimer2.Stop();

                    ExplorationViewModel.TopPageView.ViewModel.State = PageViewModel.PageViewState.Selected;
                    ExplorationViewModel.PageViewStateChanged(ExplorationViewModel.TopPageView.ViewModel, ExplorationViewModel.TopPageView);

                    ExplorationViewModel.PreviewColumn(SheetViewModel.ColumnViewModels[3]);

                    DispatcherTimer dispatcherTimer3 = new DispatcherTimer();
                    dispatcherTimer3.Tick += (sender3, e3) =>
                    {
                        dispatcherTimer3.Stop();
                        ExplorationViewModel.TopPageView.ViewModel.State = PageViewModel.PageViewState.Selected;
                        ExplorationViewModel.PageViewStateChanged(ExplorationViewModel.TopPageView.ViewModel, ExplorationViewModel.TopPageView);
                    };
                    dispatcherTimer3.Interval = TimeSpan.FromMilliseconds(500);
                    dispatcherTimer3.Start();
                };
                dispatcherTimer2.Interval = TimeSpan.FromMilliseconds(300);
                dispatcherTimer2.Start();
            };
            dispatcherTimer.Interval = TimeSpan.FromMilliseconds(500);
            dispatcherTimer.Start();
        }