public MainPage(IMainPageViewModel mainPageViewModel)
 {
     ViewModel   = mainPageViewModel;
     DataContext = mainPageViewModel;
     mainPageViewModel.MainPage = this;
     InitializeComponent();
 }
        // IMainPageViewModel viewModel )
        /// <summary>
        /// Construrtor.
        /// </summary>
        /// <param name="viewModel"></param>
        public MainPage()
        {
            _viewModel = new MainPageViewModel(); //viewModel;
            DataContext = ViewModel;

            InitializeComponent();
        }
 /// <summary>
 /// Creates an instance of the MainPage class.
 /// </summary>
 public MainPage(IMainPageViewModel viewModel)
 {
     InitializeComponent();
     //Assign the navigation, so the viewmodel can navigate between pages.
     viewModel.Navigation = this.Navigation;
     this.viewModel       = viewModel;
     this.BindingContext  = viewModel;
 }
 public ShellViewModel(IMainPageViewModel mainPageViewModel, IScreen1ViewModel screen1ViewModel, IScreen2ViewModel screen2ViewModel,
                       IEventAggregator eventAggregator, IWindowManager windowManager, ILogService logService)
 {
     _mainPageViewModel = mainPageViewModel;
     _screen1ViewModel  = screen1ViewModel;
     _screen2ViewModel  = screen2ViewModel;
     _eventAggregator   = eventAggregator;
     _windowManager     = windowManager;
     _logService        = logService;
 }
        public MainPage()
        {
            this.InitializeComponent();

            if (ViewModel == null)
            {
                ViewModel = new MainPageViewModel();
            }

            DataContext = ViewModel;
        }
Example #6
0
        private static void OnButtonClick(object sender, RoutedEventArgs e)
        {
            if (mainViewModel == null)
            {
                mainViewModel = Ioc.Resolve <IMainPageViewModel>();
                mainViewModel.PropertyChanged += OnMainViewModelPropertyChanged;

                selectedFolderItemViewModel = mainViewModel.SelectedFolderItem;
            }

            UpdateMenu();
        }
Example #7
0
		public MainPage(IMainPageViewModel viewModel, IFlagService flagService, IViewLocator viewLocator)
		{
			Title = "Currency Converter";
			_viewModel = viewModel;
			SetViewModelEvents();
			BindingContext = _viewModel;

			_flagService = flagService;
			_viewLocator = viewLocator;
			CreateUI();

			this.SetDefaultPadding();
		}
Example #8
0
        public Shell(IFaceDetectionService faceDetectionService,
                     IFaceRecogntionService faceRecognitionService,
                     IMainPageViewModel mainPageViewModel,
                     IDatabaseService databaseService,
                     IFileDirectoryService directoryService)
        {
            _faceDetectionService = faceDetectionService;
            _faceRecognionService = faceRecognitionService;
            _mainPageViewModel    = mainPageViewModel;
            _databaseService      = databaseService;
            _directoryService     = directoryService;

            InitializeServices();
        }
Example #9
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();
 }
Example #10
0
        public NavigationMenuManager(IWorkbook workbook, ISynchronizationManager synchronizationManager, IMainPageViewModel viewModel)
        {
            if (workbook == null)
            {
                throw new ArgumentNullException("workbook");
            }
            if (synchronizationManager == null)
            {
                throw new ArgumentNullException("synchronizationManager");
            }
            if (viewModel == null)
            {
                throw new ArgumentNullException("viewModel");
            }

            this.workbook = workbook;
            this.synchronizationManager = synchronizationManager;
            this.viewModel = viewModel;
            this.menuItems = this.viewModel.MenuItems;

            this.workbook.FolderAdded      += this.OnFolderAdded;
            this.workbook.FolderRemoved    += this.OnFolderRemoved;
            this.workbook.FoldersReordered += this.OnFolderReordered;

            this.workbook.SmartViewAdded      += this.OnSmartViewAdded;
            this.workbook.SmartViewRemoved    += this.OnSmartViewRemoved;
            this.workbook.SmartViewsReordered += this.OnSmartViewReordered;

            this.workbook.ContextAdded      += this.OnContextAdded;
            this.workbook.ContextRemoved    += this.OnContextRemoved;
            this.workbook.ContextsReordered += this.OnContextReordered;

            this.workbook.TagAdded      += this.OnTagAdded;
            this.workbook.TagRemoved    += this.OnTagRemoved;
            this.workbook.TagsReordered += this.OnTagReordered;

            foreach (var view in this.workbook.Views)
            {
                view.PropertyChanged += this.OnViewPropertyChanged;
            }
            this.workbook.ViewsReordered += this.OnViewsReordered;

            this.viewModel.MenuItems.CollectionChanged += this.OnMenuItemsCollectionChanged;
        }
Example #11
0
 public MainPage(IMainPageViewModel mainPageVM)
 {
     InitializeComponent();
     DataContext = mainPageVM;
 }
Example #12
0
        public MainWindow(IMainPageViewModel context)
        {
            InitializeComponent();

            DataContext = context.Get();
        }
Example #13
0
 public MainPage(IMainPageViewModel inViewModel)
 {
     InitializeComponent();
     viewModel      = inViewModel;
     BindingContext = viewModel;
 }
 public MainWindow(IMainPageViewModel viewModel) : this()
 {
     this.ViewModel = viewModel;
 }