示例#1
1
        /// <summary>
        /// Handles the Startup event of the Application control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.StartupEventArgs"/> instance containing the event data.</param>
        private void OnApplicationStartup(object sender, StartupEventArgs e)
        {
            Catel.Windows.StyleHelper.CreateStyleForwardersForDefaultStyles();

            var serviceLocator = ServiceLocator.Default;
            serviceLocator.RegisterType<IViewLocator, ViewLocator>();
            var viewLocator = serviceLocator.ResolveType<IViewLocator>();
            viewLocator.NamingConventions.Add("[UP].Views.[VM]");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInBehavior.[VM]");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInBehavior.[VM]View");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInBehavior.[VM]Window");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInViewBase.[VM]");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInViewBase.[VM]View");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInViewBase.[VM]Window");

            serviceLocator.RegisterType<IViewModelLocator, ViewModelLocator>();
            var viewModelLocator = serviceLocator.ResolveType<IViewModelLocator>();
            viewModelLocator.NamingConventions.Add("Catel.Examples.AdvancedDemo.ViewModels.[VW]ViewModel");

            // Register several different external IoC containers for demo purposes
            IoCHelper.MefContainer = new CompositionContainer();
            IoCHelper.UnityContainer = new UnityContainer();
            serviceLocator.RegisterExternalContainer(IoCHelper.MefContainer);
            serviceLocator.RegisterExternalContainer(IoCHelper.UnityContainer);

            RootVisual = new MainPage();
        }
示例#2
1
        public App()
        {
            InitializeComponent();

            MainPage = new MainPage();
        }
        /// <summary>
        /// Upon entering the scenario, ensure that we have permissions to use the Microphone. This may entail popping up
        /// a dialog to the user on Desktop systems. Only enable functionality once we've gained that permission in order to 
        /// prevent errors from occurring when using the SpeechRecognizer. If speech is not a primary input mechanism, developers
        /// should consider disabling appropriate parts of the UI if the user does not have a recording device, or does not allow 
        /// audio input.
        /// </summary>
        /// <param name="e">Unused navigation parameters</param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;

            // Keep track of the UI thread dispatcher, as speech events will come in on a separate thread.
            dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;

            // Prompt the user for permission to access the microphone. This request will only happen
            // once, it will not re-prompt if the user rejects the permission.
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                btnContinuousRecognize.IsEnabled = true;

                PopulateLanguageDropdown();
                await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
            }
            else
            {
                this.dictationTextBox.Text = "Permission to access capture resources was not given by the user, reset the application setting in Settings->Privacy->Microphone.";
                btnContinuousRecognize.IsEnabled = false;
                cbLanguageSelection.IsEnabled = false;
            }

        }
示例#4
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used when the application is launched to open a specific file, to display
        /// search results, and so forth.
        /// </summary>
        /// <param name="args">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs args)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                var mainPage = new MainPage(args.SplashScreen);
                Window.Current.Content = mainPage;
                Window.Current.Activate();

                // Setup scripting bridge
                _bridge = new WinRTBridge.WinRTBridge();
                appCallbacks.SetBridge(_bridge);

                appCallbacks.SetSwapChainBackgroundPanel(mainPage.GetSwapChainBackgroundPanel());

                appCallbacks.SetCoreWindowEvents(Window.Current.CoreWindow);

                appCallbacks.InitializeD3DXAML();
            }

            Window.Current.Activate();
        }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;

            // Populate the list of users.
            IReadOnlyList<User> users = await User.FindAllAsync();
            var observableUsers = new ObservableCollection<UserViewModel>();
            int userNumber = 1;
            foreach (User user in users)
            {
                string displayName = (string)await user.GetPropertyAsync(KnownUserProperties.DisplayName);

                // Choose a generic name if we do not have access to the actual name.
                if (String.IsNullOrEmpty(displayName))
                {
                    displayName = "User #" + userNumber.ToString();
                    userNumber++;
                }
                observableUsers.Add(new UserViewModel(user.NonRoamableId, displayName));
            }
            UserList.DataContext = observableUsers;
            if (users.Count > 0)
            {
                UserList.SelectedIndex = 0;
            }
        }
        public MainPage(Frame frame)
        {
            this.InitializeComponent();
            this.MySplitView.Content = frame;
            title = new Title();
            loggedIn = new Title();
            DataContext = title;

            rdLogin.DataContext = loggedIn;

            loggedIn.Value = Parse.ParseUser.CurrentUser == null ? "Login" : "Profile";


            DispatcherTimer dt = new DispatcherTimer();
            dt.Interval = TimeSpan.FromSeconds(1);
           
            d = DateTime.Parse("2/27/2016 13:00:00 GMT");
            dt.Tick += Dt_Tick;
            txtCountDown.Loaded += (s, e) => { dt.Start(); };
            

            MySplitView.PaneClosed += (s, e) => { bgPane.Width = 48; };
            root = this;
            rootFrame = MySplitView.Content as Frame;
        }
        private void SignInButton_Click(object sender, RoutedEventArgs e)
        {
            string qwer = PasswordTextBox.Password;
            try
            {
                //employeeAuthentication.IsAccountExists(LoginTextBox.Text);
                //if (employeeAuthentication.IsCorrectCredentialsCorrect(LoginTextBox.Text, PasswordTextBox.Text))
                //{
                //    UserAccountSC.ClientCredentials.UserName.UserName = LoginTextBox.Text;
                //    UserAccountSC.ClientCredentials.UserName.Password = PasswordTextBox.Text;
                //    MainPage mainPage = new MainPage(UserAccountSC.ClientCredentials);
                //    thisWindow.Content = mainPage;
                //}
                employeeAuthentication.IsAccountExists(LoginTextBox.Text);
                if (employeeAuthentication.IsCorrectCredentialsCorrect(LoginTextBox.Text, PasswordTextBox.Password))
                {
                    UserAccountSC.ClientCredentials.UserName.UserName = LoginTextBox.Text;
                    UserAccountSC.ClientCredentials.UserName.Password = PasswordTextBox.Password;
                    MainPage mainPage = new MainPage(UserAccountSC.ClientCredentials);
                    thisWindow.Content = mainPage;
                }


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Informacja", MessageBoxButton.OK);
            }



        }
示例#8
0
 private async void NewUserCreated_Click(object sender, RoutedEventArgs e)
 {   
     Person p1 = new Person
     {
         name = NameInput2.Text,
         pwd =PasswordInput2.Password,
         g = g1,
         ftb= ftb1,
         mv=mv1,
         disc=disc1,
         csgo=csgo1,
         age= AgeInput2.Text,
         contactno=ContactInput2.Text
      };
     await App.MobileService.GetTable<Person>().InsertAsync(p1);
     GlobalVar.Globalname = p1.name;
     GlobalVar.Globalcontact = p1.contactno;
     GlobalVar.Globalftb = p1.ftb;
     GlobalVar.Globalmv = p1.mv;
     GlobalVar.Globaldisc = p1.disc;
     GlobalVar.Globalcsgo = p1.csgo;
     GlobalVar.Globalg = p1.g;
     GlobalVar.Globalage = p1.age;
     //var m1 = new MessageDialog("Data Inserted").ShowAsync();
     NameInput2.Text = "";
     AgeInput2.Text = "";
     ContactInput2.Text = "";
     MainPage page = new MainPage();
     this.Frame.Navigate(typeof(MainPage));
     
 }
        /// <summary>
        /// Clean up the notification area when user navigate to prediction page
        /// </summary>
        /// <param name="e">Event data that describes the click action on the button.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;

            // Clean notification area.
            rootPage.NotifyUser(string.Empty, NotifyType.StatusMessage);
        }
示例#10
0
文件: App.xaml.cs 项目: bonus/Praxis
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            if (!HtmlPage.Document.QueryString.ContainsKey(ResourceManager.CultureParamName))
            {
                RootVisual = new MainPage();
                return;
            }

            string localeName = HtmlPage.Document.QueryString[ResourceManager.CultureParamName];
            WebClient client = new WebClient();

            client.OpenReadCompleted += delegate(object sender1, OpenReadCompletedEventArgs e1)
            {
                AssemblyPart part = new AssemblyPart();
                part.Load(e1.Result);

                ResourceManager.SetCulture(localeName);

                RootVisual = new MainPage();
            };

            string absoluteUri = HtmlPage.Document.DocumentUri.AbsoluteUri;
            string address = absoluteUri.Substring(0, absoluteUri.LastIndexOf("/"));

            client.OpenReadAsync(
                new Uri(
                    string.Format("{0}/ClientBin/{1}/Bonus.Praxis.SilverlightLocalization.resources.dll", address,
                                  localeName),
                    UriKind.Absolute));
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;

            // The AccountCommandsRequested event triggers before the Accounts settings pane is displayed 
            AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested += OnAccountCommandsRequested;
        }
        /// <summary>
        /// Wird aufgerufen, wenn die Anwendung durch den Endbenutzer normal gestartet wird.  Weitere Einstiegspunkte
        /// werden z. B. verwendet, wenn die Anwendung gestartet wird, um eine bestimmte Datei zu öffnen.
        /// </summary>
        /// <param name="e">Details über Startanforderung und -prozess.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            // Initialize application and graphics
            if (!SeeingSharpApplication.IsInitialized)
            {
                await SeeingSharpApplication.InitializeAsync(
                    this.GetType().GetTypeInfo().Assembly,
                    new Assembly[]
                    {
                        typeof(SeeingSharpApplication).GetTypeInfo().Assembly,
                        typeof(GraphicsCore).GetTypeInfo().Assembly
                    },
                    new string[] { e.Arguments });

                GraphicsCore.Initialize(
                    TargetHardware.Direct3D11,
                    false);
            }

            // Create the main game page and associate it withe the main window
            MainPage gamePage = new MainPage();
            Window.Current.Content = gamePage;

            // Ensure that the main window is activated
            Window.Current.Activate();
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     activeAccount = (Account)e.Parameter;
     //set inkCanvas size
     rootPage = MainPage.Current;
     this.SetGridSize();
 }
示例#14
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.rootPage = e.Parameter as MainPage;

            var hits = App.Data.Steps.Count(item => item.Answers.ToList().FindIndex(a => a.IsSelected) == item.CorrectAnswer - 1);
            var misses = Constants.QuestionsCount - hits;
            var percentageAnswered = (hits * 100) / Constants.QuestionsCount;

            if (percentageAnswered == 0)
            {
                this.ResultsLegend.Text = Constants.LeaderboardMessage4;
            }
            else if (percentageAnswered == 100)
            {
                this.ResultsLegend.Text = Constants.LeaderboardMessage1;                    
            }
            else if (percentageAnswered <= 50)
            {
                this.ResultsLegend.Text = string.Format(Constants.LeaderboardMessage3, hits);
            }
            else
            {
                this.ResultsLegend.Text = string.Format(Constants.LeaderboardMessage2, hits);
            }

            this.SendResults(hits, misses);
        }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            ResultCollection = new ObservableCollection<WiFiNetworkDisplay>();
            rootPage = MainPage.Current;

            // RequestAccessAsync must have been called at least once by the app before using the API
            // Calling it multiple times is fine but not necessary
            // RequestAccessAsync must be called from the UI thread
            var access = await WiFiAdapter.RequestAccessAsync();
            if (access != WiFiAccessStatus.Allowed)
            {
                rootPage.NotifyUser("Access denied", NotifyType.ErrorMessage);
            }
            else
            {
                DataContext = this;

                var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(WiFiAdapter.GetDeviceSelector());
                if (result.Count >= 1)
                {
                    firstAdapter = await WiFiAdapter.FromIdAsync(result[0].Id);
                    RegisterButton.IsEnabled = true;
                }
                else
                {
                    rootPage.NotifyUser("No WiFi Adapters detected on this machine", NotifyType.ErrorMessage);
                }
            }
        }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;
            // Clear the messages
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

            if (!ApplicationData.Current.RoamingSettings.Values.ContainsKey("DenyIfPhoneLocked"))
            {
                ApplicationData.Current.RoamingSettings.Values["DenyIfPhoneLocked"] = false;
            }

            if (!ApplicationData.Current.RoamingSettings.Values.ContainsKey("LaunchAboveLock"))
            {
                ApplicationData.Current.RoamingSettings.Values["LaunchAboveLock"] = false;
            }

            chkDenyIfPhoneLocked.IsChecked = (bool)ApplicationData.Current.RoamingSettings.Values["DenyIfPhoneLocked"];
            chkLaunchAboveLock.IsChecked = (bool)ApplicationData.Current.RoamingSettings.Values["LaunchAboveLock"];

            if (!(await CheckHceSupport()))
            {
                // No HCE support on this device
                btnRegisterBgTask.IsEnabled = false;
                btnAddCard.IsEnabled = false;
            }
            else
            {
                lstCards.ItemsSource = await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync();
            }
        }
 public virtual void MainPageDelete(MainPage entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       m_DataContext.ndihdMainPageDelete(entity.ID);
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
        public SettingPage()
        {
            this._mainPage = MainPage.Current;
            this._pageViewModel = new SettingPageViewModel();

            this.InitializeComponent();
        }
        /// <summary>
        /// Upon entering the scenario, ensure that we have permissions to use the Microphone. This may entail popping up
        /// a dialog to the user on Desktop systems. Only enable functionality once we've gained that permission in order to 
        /// prevent errors from occurring when using the SpeechRecognizer. If speech is not a primary input mechanism, developers
        /// should consider disabling appropriate parts of the UI if the user does not have a recording device, or does not allow 
        /// audio input.
        /// </summary>
        /// <param name="e">Unused navigation parameters</param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;

            // Keep track of the UI thread dispatcher, as speech events will come in on a separate thread.
            dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;

            // Prompt the user for permission to access the microphone. This request will only happen
            // once, it will not re-prompt if the user rejects the permission.
            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                btnContinuousRecognize.IsEnabled = true;
            }
            else
            {
                resultTextBlock.Text = "Permission to access capture resources was not given by the user, reset the application setting in Settings->Privacy->Microphone.";
            }


            Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
            string langTag = speechLanguage.LanguageTag;
            speechContext = ResourceContext.GetForCurrentView();
            speechContext.Languages = new string[] { langTag };

            speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");

            PopulateLanguageDropdown();

            // Initialize the recognizer. Since the recognizer is disposed on scenario exit, we need to make sure we re-initialize it on scenario
            // entrance, as the xaml page may not get destroyed between openings of the scenario.
            await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
        }
示例#20
0
 public MainPage()
 {
     InitializeComponent();
     if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
     {
         TitleBlock.Visibility = Visibility.Collapsed;
     }
     Current = this;
     Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested;
     MainFrame.Navigate(typeof(NowWeatherPage), this);
     license = new License.License();
     var t = ThreadPool.RunAsync(async (w) =>
     {
         var c = Convert.ToUInt64(RoamingSettingsHelper.ReadSettingsValue("MeetDataSourceOnce"));
         if (c < SystemInfoHelper.GetPackageVersionNum())
         //if (true)
         {
             RoamingSettingsHelper.WriteSettingsValue("MeetDataSourceOnce", SystemInfoHelper.GetPackageVersionNum());
             await Task.Delay(1000);
             await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(() =>
             {
                 VersionText.Text = SystemInfoHelper.GetPackageVer();
                 ShowUpdateDetail();
             }));
         }
         else
         {
             HideUpdateButton_Click(null, null);
         }
     });
 }
示例#21
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;
            file = "status.xml";
            StorageFile storageFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(file);
            XmlLoadSettings loadSettings = new XmlLoadSettings();
            loadSettings.ProhibitDtd = false;
            loadSettings.ResolveExternals = false;
            doc = await XmlDocument.LoadFromFileAsync(storageFile, loadSettings);
            try
            {
                var results = doc.SelectNodes("descendant::result");                
                int num_results = 1;
                foreach (var result in results)
                {
                    String id = results[num_results - 1].SelectSingleNode("descendant::id").FirstChild.NodeValue.ToString();
                    String status = results[num_results-1].SelectSingleNode("descendant::status").FirstChild.NodeValue.ToString();
                    listBox.Items.Add("ID: "+id+" "+ status);
                    num_results += 1;
                }
                if (num_results==1)
                    listBox.Items.Add("You don't have pending jobs.");
            }
            
            catch(Exception)
            { 
            listBox.Items.Add("You don't have pending jobs.");
            }

        }
示例#22
0
        public MainPage()
        {
            Player.Instance = new Player();

            Instance = this;

            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;

            context = SynchronizationContext.Current;

            viewManager = new ViewManager();
            viewManager.Pivot = pivot;

            commandBarManager = new CommandBarManager();
            commandBarManager.CommandBar = commandBar;
            commandBarManager.ButtonClick += feedViewControl.CommandBarButtonClick;

            viewManager.ActiveViewChanged += feedViewControl.ActiveViewChanged;
            viewManager.ActiveViewChanged += feedItemsViewControl.ActiveViewChanged;

            feedViewControl.EnableButtons += commandBarManager.EnableButtons;
            feedViewControl.ActivateView += viewManager.ActivateView;

            feedItemsViewControl.EnableButtons += commandBarManager.EnableButtons;
            feedItemsViewControl.ActivateView += viewManager.ActivateView;
            feedItemsViewControl.Play += Player.Instance.Play;

            SQLiteDb.Create();

            viewManager.SwitchTo(PivotView.Feeds);
        }
示例#23
0
		public void LoginToSite()
		{
			var doc = XDocument.Load(@"P1\" + Settings.Default.P1DataFile);

			XElement settings = doc.Document.Element("Tests").Element("settings");
			XElement pageSettings = doc.Document.Element("Tests").Element("page");

			string testName = pageSettings.Attribute("name").Value;

			_driver = StartBrowser(settings.Attribute("browser").Value);
			_baseUrl = settings.Attribute("baseURL").Value;

			Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
			Trace.WriteLine(BasePage.PreconditionsKeyWord);

			MainPage mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

			_loginPage = new LoginPage(_driver);
			_loginPage.OpenUsingUrl(_baseUrl);
			_loginPage.DoLoginUsingUrl("host", "dnnhost");

			HostSettingsPage hostSettingsPage = new HostSettingsPage(_driver);
			hostSettingsPage.OpenUsingButtons(_baseUrl);
			hostSettingsPage.Click(By.XPath(HostSettingsPage.BasicSettingsTab));
			_serverName = hostSettingsPage.FindElement(By.XPath(HostSettingsPage.HostName)).Text;

		}
示例#24
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            //  mySQLconnection.Open();

            /*
                MySqlCommand mySQLcommand = new MySqlCommand("SELECT * FROM SUser WHERE username = @username AND password = @password");

                if (this.OpenConnection() == true)
                {
                    mySQLcommand.Parameters.AddWithValue("username", UsernameTextBox.Text);
                    mySQLcommand.Parameters.AddWithValue("password", PasswordTextBox.Text);
                    MySqlDataReader dataReader = mySQLcommand.ExecuteReader();
                    while(dataReader.Read())
                    {
                        mainpage = new MainPage();
                        mainpage.Show();
                    }
                    dataReader.Close();
                }
            //mainpage = new MainPage();
               // mainpage.Show();
             * */

            DBConnect db = new DBConnect();
            DataTable dataTable = db.GetUser(PasswordTextBox.Text, UsernameTextBox.Text);
            if (dataTable != null)
            {
                mainpage = new MainPage();
                mainpage.Show();
                //MessageBox.Show(dataTable.ToString());
            }
            else MessageBox.Show("Noe gikk galt");
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     rootPage = MainPage.Current;
     var protectionPolicyManager = ProtectionPolicyManager.GetForCurrentView();
     protectionPolicyManager.Identity = ""; // personal context
     InputTxtBox.Text = "Copy and paste this text to a non-enterprise app such as notepad";
 }
示例#26
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     RootVisual = new MainPage
     {
         DataContext = new MainViewModel()
     };
 }
示例#27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LabGame" /> class.
        /// </summary>
        public GameController(MainPage mainPage)
        {
            // Creates a graphics manager. This is mandatory.
            graphicsDeviceManager = new GraphicsDeviceManager(this);

            //Slider Values

            // Setup the relative directory to the executable directory
            // for loading contents with the ContentManager
            Content.RootDirectory = "Content";

            // Create the keyboard manager
            keyboardManager = new KeyboardManager(this);
            random = new Random();
            input = new GameInput();
            size = 10;
            generateGhost = 0.99;
            // Set boundaries.
            boundaryNorth = 2.6f;
            boundaryEast = size * 10 - 2.6f;
            boundarySouth = size * 10 - 2.6f;
            boundaryWest = 2.6f;

            // Initialise event handling.
            input.gestureRecognizer.Tapped += Tapped;
            input.gestureRecognizer.ManipulationStarted += OnManipulationStarted;
            input.gestureRecognizer.ManipulationUpdated += OnManipulationUpdated;
            input.gestureRecognizer.ManipulationCompleted += OnManipulationCompleted;

            this.mainPage = mainPage;
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;

            //Listen to AccountPictureChanged event
            UserInformation.AccountPictureChanged += this.PictureChanged;
        }
        public MainPage()
        {
            this.InitializeComponent();
            Current = this;
            SampleTitle.Text = FEATURE_NAME;

        }
示例#30
0
 public Settings(MainPage parent)
 {
     this.InitializeComponent();
     this.parent = parent;
     this.navigationHelper = new NavigationHelper(this);
     this.navigationHelper.LoadState += navigationHelper_LoadState;
     this.navigationHelper.SaveState += navigationHelper_SaveState;
     sldMusic.Value = parent.game.music;
     if (parent.game.hardDifficulty == true)
     {
         hard.IsChecked = true;
     }
     else
     {
         easy.IsChecked = true;
     }
     if (parent.game.landscape.shader_option == 0)
     {
         basic.IsChecked = true;
     }
     else
     {
         custom.IsChecked = true;
     }
 }
示例#31
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;
            Object value;


            value = roamingSettings.Values["location"];
            if (value == null) value = "True";
            if (value.ToString() == "True")
                checkBox_location.IsChecked = true;
            else
                checkBox_location.IsChecked = false;
            
            value = roamingSettings.Values["time"];
            if (value == null) value = "True";
            if (value.ToString() == "True")
                checkBox_time.IsChecked = true;
            if (value.ToString() == "False")
                checkBox_time.IsChecked = false;

            value = roamingSettings.Values["fluoride"];
            if (value == null) value = "True"; 
            if (value.ToString() == "True")
                fluoride.IsChecked = true;
            if (value.ToString() == "False")
                fluoride.IsChecked = false;
        }
示例#32
0
 private async void BtnRetour_ClickedAsync(object sender, EventArgs e)
 {
     MainPage page = new MainPage();
     await Navigation.PushModalAsync(page);
 }
示例#33
0
文件: App.cs 项目: kswarna/MovieMeter
 //public static DataManager<Movie> MovieManager { get; private set; }
 public App()
 {
     //MovieManager = new DataManager<Movie>();
     InitializeComponent();
     MainPage = new MainPage();
 }
 public override void Setup()
 {
     base.Setup();
     WebDriverFactory.CurrentDriver.Url = TestSettingsManager.GetBaseUrl;
     mainPage = new MainPage();
 }
示例#35
0
 public App()
 {
     InitializeComponent();
     DependencyService.Register <MockDataStore>();
     MainPage = new MainPage();
 }
示例#36
0
 public App()
 {
     // The root page of your application
     MainPage = new MainPage();
 }
 public ProcessManager(MainPage owner, string filePath)
 {
     processOwner   = owner;
     secretFilePath = filePath;
 }
示例#38
0
        public void OpenMainPage()
        {
            mainPage = new MainPage(webDriver);

            mainPage.OpenPage();
        }
 public MainPageViewModel(MainPage parent)
 {
     _parent = parent;
 }
示例#40
0
文件: Core.cs 项目: rahulyhg/cms-cli
        /* add new triggers here */

        #endregion

        #region MainPage integration

        public static void RegisterPage(MainPage page)
        {
            UI = page;
        }
示例#41
0
 private async void ZoomResetButtonClickHandler(object sender, RoutedEventArgs e)
 {
     zoomLevel = MainPage.GetDefaultZoomLevel();
     await cardView.ChangeZoomLevel(zoomLevel);
 }
示例#42
0
 public Scenario2ViewModel()
 {
     m_dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
     m_rootPage   = MainPage.Current;
 }
示例#43
0
文件: Core.cs 项目: rahulyhg/cms-cli
 public static void UnregisterPage(MainPage page)
 {
     UI = null;
 }
示例#44
0
 protected void TabView_AddTabButtonClick(TabView sender, object args)
 {
     MainPage.AddNewTabAsync();
 }
示例#45
0
 public void SetUp()
 {
     _mainPage     = new MainPage(Driver).GoToMainPage();
     _checkboxPage = _mainPage.GoToCheckboxPage();
 }
 public async Task DisplayAlertAsync(string title, string message, string button)
 {
     await MainPage?.DisplayAlert(title, message, button);
 }
示例#47
0
 public App()
 {
     MainPage = new MainPage();
 }
        public void GivenIGoToCalalogNewModule()
        {
            MainPage mainPage = new MainPage();

            mainPage.GoToCCEN();
        }
 public async Task <bool> DisplayAlertAsync(string title, string message, string accept, string cancel)
 {
     return(await MainPage?.DisplayAlert(title, message, accept, cancel));
 }
示例#50
0
 public void SetUp()
 {
     _mainPage     = new MainPage(Driver).GoToMainPage();
     _passwordPage = _mainPage.GoToPasswordPage();
 }
示例#51
0
        public void DidAppStart()
        {
            var mainPage = new MainPage();

            mainPage.AppStarted();
        }
示例#52
0
 /// <summary>
 /// Event Handler for OnNavigateTo Event
 /// </summary>
 /// <param name="e"></param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     rootPage = MainPage.Current;
     base.OnNavigatedTo(e);
 }
示例#53
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="view"></param>
 public MainPagePresenters(MainPage view)
 {
     this.view = view;
 }
示例#54
0
 public App()
 {
     InitializeComponent();
     Akavache.Sqlite3.Registrations.Start("ApplicationName", () => SQLitePCL.Batteries_V2.Init());
     MainPage = new MainPage();
 }
示例#55
0
 public PurchaseFacade(MainPage mainPage, CartPage cartPage, CheckoutPage checkoutPage)
 {
     _mainPage     = mainPage;
     _cartPage     = cartPage;
     _checkoutPage = checkoutPage;
 }