Exemplo n.º 1
0
        public MainPage()
        {
            InitializeComponent();

            Detail         = new NavigationPage(new FilmsView());
            BindingContext = new MenuBarViewModel(this);
        }
Exemplo n.º 2
0
        public MenuBarViewModeltests()
        {
            _eventAggregatorMock = new Mock <IEventAggregator>();

            _languageChangedEventMock = new Mock <LanguageChangedEvent>();
            _eventAggregatorMock
            .Setup(ea => ea.GetEvent <LanguageChangedEvent>())
            .Returns(_languageChangedEventMock.Object);

            _menuBarViewModel = new MenuBarViewModel(_eventAggregatorMock.Object);
        }
Exemplo n.º 3
0
        public MenuBarView(MenuBarViewModel viewModel, IUnityContainer container, IEventAggregator events)
        {
            InitializeComponent();

            Events    = events;
            Container = container;

            BindingContext = ViewModel = viewModel;

            Events.GetEvent <OrientationEvent> ().Subscribe(OnOrientationEventReceived);
        }
		public MenuBarView (MenuBarViewModel viewModel, IUnityContainer container, IEventAggregator events)
		{
			InitializeComponent ();

			Events = events;
			Container = container;

			BindingContext = ViewModel = viewModel;

			Events.GetEvent<OrientationEvent> ().Subscribe (OnOrientationEventReceived);
		}
Exemplo n.º 5
0
        public MainPageViewModel(IUiService uiService, MenuBarViewModel menuBarViewModel)
            : base(uiService)
        {
            AddLocationsPopup = menuBarViewModel;

            IsAddLocationsPopupVisible = false;
            LoadAddLocationsPopupMenuItems();

            DisplayName = "Where Am I";

            WaypointsRepository repository = WaypointsRepositoryFactory.Create();
            Waypoints           waypoints  = new Waypoints();

            waypoints.Add(CreateWaypoint());

            Waypoints savedWaypoints = null;

            Task.Run(() => savedWaypoints = repository.LoadAsync().Result).Wait();

            //TODO: Delete!!!
            if (savedWaypoints.Count == 0)
            {
                savedWaypoints.PopulateWithMockData();
                repository.SaveAsync(savedWaypoints);
            }

            WaypointList = new ObservableCollection <Waypoint>(savedWaypoints.ToArray());
            var location = GetCurrentLocation();

            if (location == null)
            {
                MessageDialog message = new MessageDialog("GPSLocationNotResolved");
                Task.Run(() => message.ShowAsync()).Wait();
            }
            else
            {
                CurrentLocationLatitude  = location.Latitude;
                CurrentLocationLongitude = location.Longitude;
            }
        }
Exemplo n.º 6
0
 public MenuBar()
 {
     InitializeComponent();
     BindingContext = new MenuBarViewModel(Navigation);
 }
Exemplo n.º 7
0
        public MenuBarView(MenuBarViewModel viewModel)
        {
            DataContext = viewModel;

            InitializeComponent();
        }