/// <summary>
        /// Initializes class instance.
        /// </summary>
        public WelcomeViewModel()
        {
            _pageNavigation   = DependencyService.Get <IPageNavigation>();
            _findPlaceService = DependencyService.Get <IFindPlaceService>();

            GoToPlacesPageCommand = new Command(ExecuteGoToPlacesPageAsync);
        }
        public CommentPhotoPage(
            IPageNavigation navigation,
            IDictionary <string, string> parameters,
            IProtocolCommunication protocolCommunication
            )
        {
            _navigation            = navigation;
            _protocolCommunication = protocolCommunication;

            parameters.TryGetValue("username", out _username);
            if (_username == null)
            {
                throw new Exception("Parameter \"username\" required");
            }

            parameters.TryGetValue("photoName", out _photoName);
            if (_photoName == null)
            {
                throw new Exception("Parameter \"photoName\" required");
            }

            _retryMenu = new Menu(
                options: new List <(string, string)>
            {
                (RetryAction, "Retry"),
                (GoBackAction, "Back")
            },
Пример #3
0
        public LoginPageViewModel()
        {
            _navigation = DependencyService.Get <IPageNavigation>();

            GoBackToMessengerPageCommand = new Command(ExecuteGoBackToMessengerPage);

            AddFriend = new Command(ExecuteAddFriend);

            RemoveFriend = new Command(ExecuteRemoveFriend);

            SendCommand = new Command(ExecuteSendCommand);

            client.LoginOK += new EventHandler(_LoginOK);

            client.RegisterOK += new EventHandler(_RegisterOK);

            client.LoginFailed += new ErrorEventHandler(_LoginFailed);

            client.RegisterFailed += new ErrorEventHandler(_RegisterFailed);

            client.Disconnected += new EventHandler(_Disconnected);

            client.UserAvailable += new AvailableEventHandler(_UserAvailable);

            client.MessageReceived += new ReceivedEventHandler(_MessegeReceived);
        }
        /// <summary>
        /// Initializes QRCodeViewModel class instance.
        /// </summary>
        public QRCodeViewModel()
        {
            _navigation             = DependencyService.Get <IPageNavigation>();
            GoToPreviousPageCommand = new Command(ExecuteGoToPreviousPageCommand);

            ImagePath = MainModel.Instance.Generate();
        }
Пример #5
0
        private static void PageRightExecute(object sender, ExecutedRoutedEventArgs e)
        {
            IPageNavigation navigation = e.Parameter as IPageNavigation;

            if (navigation != null)
            {
                navigation.PageRight();
            }
        }
Пример #6
0
        private static void PageUpExecute(object sender, ExecutedRoutedEventArgs args)
        {
            IPageNavigation navigation = args.Parameter as IPageNavigation;

            if (navigation != null)
            {
                navigation.PageUp();
            }
        }
 public LandingPage(IPageNavigation navigation)
 {
     _navigation = navigation;
     _menu       = new Menu(
         options: new List <(string, string)>
     {
         (IPageNavigation.LoginPage, "Login"),
         (IPageNavigation.SignUpPage, "Sign up"),
         (null, "Exit"),
     },
Пример #8
0
 public HomePage(IPageNavigation navigation)
 {
     _navigation = navigation;
     _menu       = new Menu(
         options: new List <(string, string)>
     {
         (UploadPhotoAction, "Upload new photo"),
         (UsersListAction, "Show users"),
         (LogOutAction, "Logout"),
     },
Пример #9
0
        private static void PageLeftCanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            e.Handled = true;
            IPageNavigation navigation = e.Parameter as IPageNavigation;

            if (navigation != null)
            {
                e.CanExecute = navigation.CanPageLeft();
            }
        }
Пример #10
0
 public SignUpPage(IPageNavigation navigation, IProtocolCommunication protocolCommunication)
 {
     _navigation            = navigation;
     _protocolCommunication = protocolCommunication;
     _menu = new Menu(
         options: new List <(string, string)>
     {
         (RetryAction, "Try Again"),
         (BackAction, "Back"),
         (ExitAction, "Exit"),
     },
        public UploadPhotoPage(
            IPageNavigation navigation,
            IProtocolCommunication protocolCommunication
            )
        {
            _navigation            = navigation;
            _protocolCommunication = protocolCommunication;

            _retryMenu = new Menu(
                options: new List <(string, string)>
            {
                (RetryAction, "Retry"),
                (GoBackAction, "Back")
            },
Пример #12
0
        public GeneratorPageNavigation(IPageNavigation goTo)
        {
            if (goTo.BeforeObject != null && goTo.BeforeObjectEvent != null)
            {
                BeforeObject      = GeneratorObject.GeneratorObjectMap[goTo.BeforeObject];
                BeforeObjectEvent = GeneratorObjectEvent.GeneratorObjectEventMap[goTo.BeforeObjectEvent];
            }

            if (goTo.GoToObject != null && goTo.GoToObjectProperty != null)
            {
                GoToPage           = null;
                IsExternal         = true;
                GoToObject         = GeneratorObject.GeneratorObjectMap[goTo.GoToObject];
                GoToObjectProperty = (IGeneratorObjectPropertyReadonlyString)GeneratorObjectProperty.GeneratorObjectPropertyMap[goTo.GoToObjectProperty];
            }
            else
            {
                if (goTo.GoToPage == Page.CurrentPage)
                {
                    GoToPage = GeneratorPage.CurrentPage;
                }
                else if (goTo.GoToPage == Page.PreviousPage)
                {
                    GoToPage = GeneratorPage.PreviousPage;
                }
                else if (goTo.GoToPage == Page.AnyPage)
                {
                    GoToPage = GeneratorPage.AnyPage;
                }
                else
                {
                    GoToPage = GeneratorPage.GeneratorPageMap[goTo.GoToPage];
                }

                IsExternal         = goTo.IsExternal;
                GoToObject         = null;
                GoToObjectProperty = null;
            }

            if (goTo.AfterObject != null && goTo.AfterObjectEvent != null)
            {
                AfterObject      = GeneratorObject.GeneratorObjectMap[goTo.AfterObject];
                AfterObjectEvent = GeneratorObjectEvent.GeneratorObjectEventMap[goTo.AfterObjectEvent];
            }
        }
Пример #13
0
 public BaseViewModel()
 {
     this._navigationService = DependencyService.Get <IPageNavigation>();
     //this._dialogService = DependencyService.Get<IDialog>();
 }
Пример #14
0
 /// <summary>
 /// Initializes MainViewModel class instance
 /// </summary>
 public MainViewModel()
 {
     _navigation = DependencyService.Get <IPageNavigation>();
     GoToInstructionPageCommand = new Command(ExecuteGoToInstructionPageCommand);
 }
Пример #15
0
 public NavigationService(IPageFactory pageFactory, IPageNavigation pageNavigation)
 {
     ServiceProvider = BuildingBlocksApplication.ServiceProvider;
     PageFactory     = pageFactory;
     PageNavigation  = pageNavigation;
 }
Пример #16
0
        /// <summary>
        /// Initializes class instance.
        /// </summary>
        public MainViewModel()
        {
            _navigation = DependencyService.Get <IPageNavigation>();

            InitCommands();
        }