Esempio n. 1
0
        public void Initialize()
        {
            this.dbContext = new FakeDatabaseContext();
            this.workbook  = new Workbook(this.dbContext, WinSettings.Instance);

            this.views = new List <ISystemView>
            {
                new SystemView {
                    ViewKind = ViewKind.Today
                },
                new SystemView {
                    ViewKind = ViewKind.Tomorrow
                },
                new SystemView {
                    ViewKind = ViewKind.Starred
                },
                new SystemView {
                    ViewKind = ViewKind.Late
                }
            };

            foreach (var view in this.views)
            {
                this.dbContext.AddSystemView(view);
            }

            this.workbook.Initialize();

            UITestHelper.ExecuteOnUIThread(() =>
            {
                this.viewmodel = this.CreateMainPageViewModel();
                var manager    = new NavigationMenuManager(this.workbook, new TestSynchronizationManager(), this.viewmodel);
            });
        }
 public NavigationMenuDataController(
     NavigationMenuManager navigationMenuManager,
     ILogger <SecurityPoolManager> logger,
     SiteAdminContextAccessor siteContextAccessor
     ) : base(siteContextAccessor, logger)
 {
     _navigationMenuManager = navigationMenuManager;
 }
 public NavMenuWidgetConfigForm(SiteContext siteContext, ConnectDbContext db,
                                NavMenuWidgetService widgetService, UserContext userContext, NavigationMenuManager navMenuManager)
 {
     _siteContext    = siteContext;
     _db             = db;
     _widgetService  = widgetService;
     _userContext    = userContext;
     _navMenuManager = navMenuManager;
 }
Esempio n. 4
0
        public void Starts_with_2_smart_views()
        {
            UITestHelper.ExecuteOnUIThread(() =>
            {
                this.viewmodel = this.CreateMainPageViewModel();

                var manager = new NavigationMenuManager(this.workbook, new TestSynchronizationManager(), this.viewmodel);

                this.AssertMenu();

                this.views[0].IsEnabled = true;
                this.workbook.AddSmartView("sv1", SmartViewRule);
                this.workbook.AddSmartView("sv2", SmartViewRule);


                this.AssertMenu("today", "", "sv1", "sv2");
            });
        }
Esempio n. 5
0
        public MainPage()
        {
            this.InitializeComponent();

            this.workbook          = Ioc.Resolve <IWorkbook>();
            this.navigationService = Ioc.Resolve <INavigationService>();
            this.messageBoxService = Ioc.Resolve <IMessageBoxService>();
            this.trackingManager   = Ioc.Resolve <ITrackingManager>();
            this.tileManager       = Ioc.Resolve <ITileManager>();
            this.platformService   = Ioc.Resolve <IPlatformService>();

            // setup cache mode so that this page is cached accross navigation
            this.NavigationCacheMode = NavigationCacheMode.Required;

            this.viewModel = Ioc.Build <MainPageViewModel>();
            this.viewModel.PropertyChanged += this.OnViewModelPropertyChanged;
            Ioc.RegisterInstance <IMainPageViewModel, MainPageViewModel>(this.viewModel);

            this.navigationMenuManager    = Ioc.Build <NavigationMenuManager>();
            this.taskListSelectionManager = new GridViewSelectionManager(this.workbook, this.viewModel, this.GridViewTasks);
            this.dragDropManager          = new DragDropManager(this, this.GridViewTasks, this.ListViewNavigation, this.workbook, this.navigationService, this.trackingManager);

            this.lastSplitViewOpen = !this.workbook.Settings.GetValue <bool>(CoreSettings.NavigationMenuMinimized);

            this.Loaded      += this.OnLoaded;
            this.SizeChanged += this.OnSizeChanged;

            this.DataContext = this.viewModel;

            this.HeaderBarAutoSuggestBox.QuerySubmitted += (s, e) =>
            {
                this.HeaderBarAutoSuggestBox.Focus(FocusState.Programmatic);
            };
            this.HeaderBarAutoSuggestBox.GotFocus += (s, e) =>
            {
                this.PanelHeaderContent.Visibility = Visibility.Collapsed;
                this.HeaderBarAutoSuggestBoxBorderMask.Visibility = Visibility.Collapsed;
            };
            this.HeaderBarAutoSuggestBox.LostFocus += (s, e) =>
            {
                if (string.IsNullOrWhiteSpace(this.ViewModel.SearchText))
                {
                    this.PanelHeaderContent.Visibility = Visibility.Visible;
                    this.HeaderBarAutoSuggestBoxBorderMask.Visibility = Visibility.Visible;
                }
            };

            // when user types text in the search box, update the view model
            var synchronizationContext = SynchronizationContext.Current;

            Observable
            .FromEventPattern <AutoSuggestBoxTextChangedEventArgs>(this.NavBarAutoSuggestBox, "TextChanged")
            .Throttle(TimeSpan.FromMilliseconds(250))
            .ObserveOn(synchronizationContext)
            .Subscribe(e => this.viewModel.SearchText = this.NavBarAutoSuggestBox.Text);
            Observable
            .FromEventPattern <AutoSuggestBoxTextChangedEventArgs>(this.HeaderBarAutoSuggestBox, "TextChanged")
            .Throttle(TimeSpan.FromMilliseconds(250))
            .ObserveOn(synchronizationContext)
            .Subscribe(e => this.viewModel.SearchText = this.HeaderBarAutoSuggestBox.Text);

            DataTransferManager.GetForCurrentView().DataRequested += this.OnDataRequested;

            this.SplitView.RegisterPropertyChangedCallback(SwipeableSplitView.IsSwipeablePaneOpenProperty, this.OnSplitViewIsOpenChanged);

            this.ContextualActionBar.Visibility = Visibility.Collapsed;
            this.ContextualActionBar.Initialize(this.SelectionManager);

            this.ListViewTasks.Tapped += (s, e) =>
            {
                this.navigationService.CloseFlyouts();
            };
        }
Esempio n. 6
0
 public NavigationMenuAddForm(NavigationMenuManager navigationMenuManager)
 {
     _navigationMenuManager = navigationMenuManager;
 }
 public NavigationMenuItemEditForm(NavigationMenuManager navigationMenuManager, SiteAdminContext siteAdminContext)
 {
     _navigationMenuManager = navigationMenuManager;
     _siteAdminContext      = siteAdminContext;
 }
 public NavigationMenuEditForm(NavigationMenuManager navigationMenuManager)
 {
     _navigationMenuManager = navigationMenuManager;
 }
Esempio n. 9
0
 public NavMenuViewService(NavMenuDbContext navMenuDb, ConnectDbContext connectDb, NavigationMenuManager navMenuManager)
 {
     _navMenuDb      = navMenuDb;
     _connectDb      = connectDb;
     _navMenuManager = navMenuManager;
 }