Exemple #1
0
        protected internal SignInPage(PhoneApplicationPage page)
            : base(page)
        {
            SignIn = new SimpleActionCommand(_ => SelectServiceProvider.Execute(ClientData.VidyanoServiceProvider));
            RetryConnect = new SimpleActionCommand(async _ =>
            {
                if (State == SignInPageState.NoInternet)
                    await Connect();
            });
            SelectServiceProvider = new SimpleActionCommand(provider =>
            {
                selectedProvider = (ServiceProvider)provider;
                promptServiceProviderWaiter.Set();
            });

            Page.BackKeyPress += (_, e) =>
            {
                promptServiceProviderWaiter.Set();
                if (oauthBrowserWaiter != null)
                    oauthBrowserWaiter.Set();

                if (ClientData != null && !String.IsNullOrEmpty(ClientData.DefaultUserName))
                    e.Cancel = true;
            };
        }
        protected VidyanoPage(PhoneApplicationPage page)
        {
            Page = page;
            Orientation = page.Orientation;

            Search = new SimpleActionCommand(e =>
            {
                IsSearchOpen = false;
                OnSearch(e as string);
            });

            page.Loaded += Page_Loaded;
            page.Unloaded += Page_Unloaded;
        }
Exemple #3
0
        public SignInPage(LayoutAwarePage page)
            : base(page)
        {
            Template = (DataTemplate)Application.Current.Resources["SignInPage"];
            try
            {
                SearchPane.GetForCurrentView().ShowOnKeyboardInput = false;
            }
            catch
            {
                // Throws an "Element not found" exception, even though this is called after OnLaunched
            }

            SignIn = new SimpleActionCommand(async _ => await TrySignIn());
            CancelSignIn = new ActionCommand(_ => promptServiceProviderWaiter.Set(), _ => ClientData != null && !String.IsNullOrEmpty(ClientData.DefaultUserName), this, "ClientData");
            RetryConnect = new SimpleActionCommand(async _ => await Connect());
            SelectServiceProvider = new ActionCommand(provider =>
            {
                selectedProvider = (ServiceProvider)provider;
                promptServiceProviderWaiter.Set();
            }, provider =>  (provider is ServiceProvider && ((ServiceProvider)provider).Name != "Vidyano") || (!String.IsNullOrEmpty(Password) && !String.IsNullOrEmpty(UserName)), this, "UserName", "Password");

            page.KeyUp += Page_KeyUp;
        }
 internal QueryItemSelectPage(LayoutAwarePage page)
     : base(page)
 {
     CancelCommand = new SimpleActionCommand(e => page.Frame.SetNavigationState(previousState));
     Template = (DataTemplate)Application.Current.Resources["QueryItemSelectPage"];
 }