示例#1
0
        public PanelManager(IMainPage main, IPanel startingPanel = null)
        {
            this.InitializeComponent();

            // Create
            m_mainPage = main;

            // Set the initial panel size size
            OnScreenSizeChanged((int)Window.Current.Bounds.Width, true);
            Window.Current.SizeChanged += Windows_SizeChanged;

            // Set the starting panel
            if (startingPanel != null)
            {
                startingPanel.PanelSetup(this, new Dictionary <string, object>());
                FireOnNavigateTo(startingPanel);
                m_panelStack.Add(new StackItem()
                {
                    Panel = startingPanel, Id = "StartingPanel"
                });
                ui_contentRoot.Children.Add((UserControl)startingPanel);
            }

            // Set the back button
            UpdateBackButton();

            // Register for app suspend commands
            App.BaconMan.OnSuspending += OnSuspending;
            App.BaconMan.OnResuming   += OnResuming;

            // Register for memory pressure callbacks
            App.BaconMan.MemoryMan.OnMemoryCleanUpRequest += MemoryMan_OnMemoryCleanUpRequest;
        }
示例#2
0
        // Preform different operations to return to SingleSelectPage and UnplacedPage for IOS/Android.
        private void ReturnToBasePage(IMainPage page)
        {
            if (Device.RuntimePlatform == Device.iOS)
            {
                ((IMainPage)currentPageContainer).SetLayout(page.GetLayout());
                currentPageContainer.BackgroundColor = ContentManager.ThemeColor;
                currentPageContainer.Content.AddEffect(new SafeAreaPadding());
                resizeIconAction?.Invoke();
            }
            else// No work
            {
                Console.WriteLine("Page Controller 322 Root Overwritten");
                ContentManager.SetNativeViewFunction(this);
                //  currentPageContainer.Content = null;
                ((IMainPage)currentPageContainer).SetLayout(page.GetLayout());

                /*
                 *
                 * var index = Children.IndexOf(currentPageContainer);
                 * Children.Remove(currentPageContainer);
                 * currentPageContainer = (ContentPage)page;
                 * currentPageContainer.Content = page.GetLayout();
                 * currentPageContent = page.GetLayout();
                 * Children.Insert(index, currentPageContainer);
                 * CurrentPage = currentPageContainer;
                 * navigationStack.Add((ContentPage)page, new List<string>());
                 * navigationParams.Add((ContentPage)page, new List<List<object>>());*/
            }
        }
        public UsbDriveViewModel(IMainPage pageowner)
        {
            this.PageOwner = pageowner;

            OpenFolderCommand = new DelegateCommand <object>(OpenFolderCommandAction);
            ReloadCommand     = new DelegateCommand(() => { LoadExternalDrives(); });
        }
 public EditContactPageViewModel(IMainPage mainPage, INavigationController navigationController,
                                 IContactService contactService, INotificationService notificationService,
                                 ContactModel model) : base(
         mainPage, navigationController, contactService, notificationService)
 {
     Contact = model;
 }
 public MainPageModel(IMainPage page)
 {
     InitializeNewGameRentals();
     _page = page;
     EditProfileCommand = new Command(async() => await _page.EditProfileAsync());
     LogInCommand       = new Command(async() => await _page.LogInAsync());
     LogOutCommand      = new Command(async() => await _page.LogOutAsync());
 }
示例#6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainPageSteps" /> class.
        /// </summary>
        /// <param name="setUp">The set up.</param>
        /// <param name="mainPage">The main page.</param>

        public MainPageSteps(ISetUp setUp, IMainPage mainPage, IAnalytics analytics)
        {
            TestConfiguration.CurrentScenario = ScenarioContext.Current.ScenarioInfo.Title;

            this.mainPage  = mainPage;
            this.setUp     = setUp;
            this.analytics = analytics;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainPagePresenter" /> class.
        /// </summary>
        /// <param name="mainPage">The main page.</param>
        /// <param name="signupPresenterResolver">The signup presenter resolver.</param>
        /// <param name="signInPresenterResolver">The sign in presenter resolver.</param>
        public MainPagePresenter(IMainPage mainPage, Func <ISignupPresenter> signupPresenterResolver, Func <ISignInPresenter> signInPresenterResolver)
        {
            this.MainPage = mainPage;
            this.SignupPresenterResolver = signupPresenterResolver;
            this.SignInPresenterResolver = signInPresenterResolver;

            this.MainPage.SignUpButtonClick += MainPage_SignUpButtonClick;
            this.MainPage.SignInButtonClick += MainPage_SignInButtonClick;
        }
示例#8
0
        public WindowsTypeViewModel(IMainPage view)
        {
            this.view       = view;
            OnSelectCommand = new Command(DoSelect);
            List <WindowType> pages = new List <WindowType>();

            pages.Add(new WindowType()
            {
                Description = "Одинарное глухое окно", Image = "k11.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Одинарное окно с поворотной створкой", Image = "k12.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Одинарное окно с поворотно-откидной створкой", Image = "k13.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Двойное окно с поворотной створкой", Image = "k21.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Двойное окно с поворотно-откидной створкой", Image = "k22.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Тройное окно с одной поворотной створкой", Image = "k31.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Тройное окно с одной поворотно-откидной створкой", Image = "k32.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Тройное окно с двумя поворотными створками", Image = "k33.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Тройное окно с двумя поворотно-откидными створками", Image = "k34.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Балконная поворотная дверь", Image = "k41.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Балконный блок с глухим окном и поворотной дверью", Image = "k42.png"
            });
            pages.Add(new WindowType()
            {
                Description = "Балконный блок с глухим окном и поворотно-откидной дверью", Image = "k43.png"
            });
            Pages = new ObservableCollection <WindowType>(pages);
        }
 public LoginPageController BuildController(LoginPageControllerMocks mocks, IMainPage mainPage)
 {
     return(new LoginPageController
            (
                mainPage,
                mocks.JwtTokenManager.Object,
                mocks.CreateLoginPage.Object,
                mocks.LrpNavigation.Object
            ));
 }
示例#10
0
 public MainPageController BuildController(MainPageControllerMocks mocks, IMainPage mainPage)
 {
     return(new MainPageController
            (
                mainPage,
                mocks.MainPageViewModel.Object,
                mocks.LrpNavigation.Object,
                mocks.UomMvcBuilder.Object
            ));
 }
        private void GetData()
        {
            HamburgerMenuIconItem = this.DataContext as HamburgerMenuIconItem;

            IMainPage mainPages = HamburgerMenuIconItem.Tag as IMainPage;

            if (!mainPages.HasController)
            {
                mainPages.SetController(this);
            }
        }
示例#12
0
        public void Setup()
        {
            var pagePlatform = Environment.GetPagePlatformFromEnvironment(executingPlatform, localPreference);

            app       = Configure(pagePlatform);
            container = ContainerConfig.Configure(app, pagePlatform);

            mainPage     = container.Resolve <IMainPage> ();
            optionsPage  = container.Resolve <IOptionsPage> ();
            shippingPage = container.Resolve <IShippingPage> ();
        }
示例#13
0
 protected ContactPageViewModelBase(IMainPage mainPage, INavigationController navigationController,
                                    IContactService contactService, INotificationService notificationService)
 {
     MainPage             = mainPage;
     ContactService       = contactService;
     NotificationService  = notificationService;
     NavigationController = navigationController;
     Contact = new ContactModel {
         DateOfBirth = DateTime.Today
     };
     SaveCommand = new RelayCommand(SaveBase);
     ExitCommand = new RelayCommand(Exit);
 }
示例#14
0
        public CarsViewModel(IMainPage view)
        {
            this.view        = view;
            service          = DependencyService.Get <IDataService <Car> >();
            DetailCarCommand = new Command <Car>(c => DoDetailCarCommand(c));
            AddCarCommand    = new Command(DoAddCarCommand);
            EditCarCommand   = new Command <Car>(c => DoEditCarCommand(c));
            ExecuteLoadCarsCommand();

            MessagingCenter.Subscribe <EditCarViewModel, Car>(this, "EditCar", async(obj, item) =>
            {
                await ExecuteLoadCarsCommand();
            });
        }
示例#15
0
 public MainPageController
 (
     IMainPage mainPage,
     IMainPageViewModel mainPageViewModel,
     ILrpNavigation navigation,
     ICollectionMvcBuilder <Uom> uomMvcBuilder
 )
 {
     _mainPage          = mainPage ?? throw new ArgumentNullException(nameof(mainPage));
     _mainPageViewModel = mainPageViewModel ?? throw new ArgumentNullException(nameof(mainPageViewModel));
     _navigation        = navigation ?? throw new ArgumentNullException(nameof(navigation));
     _uomMvcBuilder     = uomMvcBuilder ?? throw new ArgumentNullException(nameof(uomMvcBuilder));
     WireController();
 }
示例#16
0
        public MainPagePresenter(IMainPage iMainPage)
        {
            this.iMainPage = iMainPage;

            iMainPage.eventList.ColumnCount             = 3;
            iMainPage.eventList.Columns[0].Name         = "Subject Code";
            iMainPage.eventList.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            iMainPage.eventList.Columns[1].Name         = "Study Name";
            iMainPage.eventList.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            iMainPage.eventList.Columns[2].Name         = "Type";
            iMainPage.eventList.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            iMainPage.eventList.Columns.Add(column);
            iMainPage.eventList.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            column.HeaderText = "Progress";
        }
示例#17
0
        public HomePageLocalViewModel(IMainPage owner)
        {
            PageOwner         = owner;
            AddFolderCommand  = new DelegateCommand(AddFolderCommandAction);
            OpenFolderCommand = new DelegateCommand <VideoFolder>(OpenFolderCommandAction);

            IEventManager.GetEvent <NoFolderNoticeEventToken>().Subscribe((o) =>
            {
                HasNoFolderAction();
            });

            IEventManager.GetEvent <FolderItemChangeEventToken>().Subscribe((o) =>
            {
                RaisePropertyChanged(() => this.AllFoldersList);
            });
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="LoginPresenter" /> class.
 /// </summary>
 /// <param name="loginPage">The login page.</param>
 /// <param name="mainPage">The main page.</param>
 /// <param name="loginViewModel">The login view model.</param>
 /// <param name="device">The device.</param>
 /// <param name="securityServiceClient">The security service client.</param>
 /// <param name="transactionProcessorAclClient">The transaction processor acl client.</param>
 /// <param name="analysisLogger">The analysis logger.</param>
 public LoginPresenter(ILoginPage loginPage,
                       IMainPage mainPage,
                       LoginViewModel loginViewModel,
                       IDevice device,
                       ISecurityServiceClient securityServiceClient,
                       ITransactionProcessorACLClient transactionProcessorAclClient,
                       IAnalysisLogger analysisLogger)
 {
     this.MainPage                      = mainPage;
     this.LoginPage                     = loginPage;
     this.LoginViewModel                = loginViewModel;
     this.Device                        = device;
     this.SecurityServiceClient         = securityServiceClient;
     this.TransactionProcessorAclClient = transactionProcessorAclClient;
     this.AnalysisLogger                = analysisLogger;
 }
示例#19
0
 public LoginPageController
 (
     IMainPage mainPage,
     IJwtTokenManager tokenManager,
     Func <ILoginPage> createLoginPage,
     ILrpNavigation navigation
 )
 {
     _navigation = navigation ?? throw new ArgumentNullException(nameof(navigation));
     if (mainPage == null)
     {
         throw new ArgumentNullException(nameof(mainPage));
     }
     mainPage.OnAppearingCalledEvent += MainPageOnAppearingCalled;
     _tokenManager    = tokenManager ?? throw new ArgumentNullException(nameof(tokenManager));
     _createLoginPage = createLoginPage ?? throw new ArgumentNullException(nameof(createLoginPage));
 }
示例#20
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();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="LoginPresenter" /> class.
 /// </summary>
 /// <param name="loginPage">The login page.</param>
 /// <param name="mainPage">The main page.</param>
 /// <param name="testModePage">The test mode page.</param>
 /// <param name="supportPage">The support page.</param>
 /// <param name="loginViewModel">The login view model.</param>
 /// <param name="mainPageViewModel">The main page view model.</param>
 /// <param name="testModePageViewModel">The test mode page view model.</param>
 /// <param name="device">The device.</param>
 /// <param name="database">The logging database.</param>
 public LoginPresenter(ILoginPage loginPage,
                       IMainPage mainPage,
                       ITestModePage testModePage,
                       ISupportPage supportPage,
                       LoginViewModel loginViewModel,
                       MainPageViewModel mainPageViewModel,
                       TestModePageViewModel testModePageViewModel,
                       IDevice device,
                       IDatabaseContext database)
 {
     this.MainPage              = mainPage;
     this.TestModePage          = testModePage;
     this.SupportPage           = supportPage;
     this.LoginPage             = loginPage;
     this.LoginViewModel        = loginViewModel;
     this.MainPageViewModel     = mainPageViewModel;
     this.TestModePageViewModel = testModePageViewModel;
     this.Device   = device;
     this.Database = database;
 }
示例#22
0
 /// <summary>
 /// 初始化视图模型服务
 /// </summary>
 /// <param name="root">当前应用程序的主界面</param>
 public void Initialize(IMainPage root)
 {
     this.Root = root;
     this.Root.RegisterViews();
     Messager.Default.Initialize();
     JumpToDefaultPage();
 }
示例#23
0
 public CommonSteps(IBasePage basePage, IMainPage loginPage, ScenarioContext scenarioContext)
 {
     _basePage        = basePage;
     _scenarioContext = scenarioContext;
     _mainPage        = loginPage;
 }
 /// <summary>
 /// 初始化视图模型服务
 /// </summary>
 /// <param name="root">当前应用程序的主界面</param>
 public static void Initialize(IMainPage root)
 {
     Root = root;
     Root.RegisterViews();
     JumpToDefaultPage();
 }
 public MainPageController(IMainPage mainPage) : base(Module)
 {
     _mainPage = mainPage;
 }
 public MainPresenter(MainView view)
 {
     View         = view;
     MainPageImpl = DependencyService.Get <IMainPage>();
 }
示例#27
0
 protected override void OnViewAttached(object view, object context)
 {
     base.OnViewAttached(view, context);
     _view = view as IMainPage;
 }
 public NavigationService(IMainPage presentationRoot, IViewLocator viewLocator)
 {
     _presentationRoot = presentationRoot;
     _viewLocator      = viewLocator;
 }
示例#29
0
 public SheetViewModel(MainPageViewModel mainPageViewModel, IMainPage view)
 {
     this.mainPageViewModel = mainPageViewModel;
     this.view = view;
 }
 public AddContactPageViewModel(IMainPage mainPage, INavigationController navigationController,
                                IContactService contactService, INotificationService notificationService) : base(mainPage,
                                                                                                                 navigationController, contactService, notificationService)
 {
 }
示例#31
0
 public SelectionViewModel(MainPageViewModel mainPageViewModel, IMainPage view)
 {
     this.mainPageViewModel = mainPageViewModel;
     this.view = view;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MainPageSteps"/> class.
 /// </summary>
 /// <param name="setUpDriver">The set up driver.</param>
 /// <param name="mainPage">The main page.</param>
 public MainPageSteps(ISetUp setUpDriver, IMainPage mainPage)
 {
     this.setUpDriver = setUpDriver;
     this.mainPage    = mainPage;
 }
示例#33
0
        public PanelManager(IMainPage main, IPanel startingPanel = null)
        {
            this.InitializeComponent();

            // Create
            m_mainPage = main;

            // Set the initial panel size size
            OnScreenSizeChanged((int)Window.Current.Bounds.Width, true);
            Window.Current.SizeChanged += Windows_SizeChanged;

            // Set the starting panel
            if (startingPanel != null)
            {
                startingPanel.PanelSetup(this, new Dictionary<string, object>());
                FireOnNavigateTo(startingPanel);
                m_panelStack.Add(new StackItem() { Panel = startingPanel, Id = "StartingPanel" });
                ui_contentRoot.Children.Add((UserControl)startingPanel);
            }

            // Set the back button
            UpdateBackButton();

            // Register for app suspend commands
            App.BaconMan.OnSuspending += OnSuspending;
            App.BaconMan.OnResuming += OnResuming;

            // Register for memory pressure callbacks
            App.BaconMan.MemoryMan.OnMemoryCleanUpRequest += MemoryMan_OnMemoryCleanUpRequest;
        }
 public MainWindowViewModel(INavigationController navigationController, IMainPage mainPage)
 {
     NavigationController             = navigationController;
     navigationController.CurrentPage = (Page)mainPage;
 }