상속: ISplashScreen
예제 #1
0
		public MainPage()
		{
			this.InitializeComponent();
			NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;

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

			appCallbacks.RenderingStarted += () => { RemoveSplashScreen(); };

#if !UNITY_WP_8_1
			appCallbacks.SetKeyboardTriggerControl(this);
#endif
			appCallbacks.SetSwapChainPanel(GetSwapChainPanel());
			appCallbacks.SetCoreWindowEvents(Window.Current.CoreWindow);
			appCallbacks.InitializeD3DXAML();

			splash = ((App)App.Current).splashScreen;
			GetSplashBackgroundColor();
			OnResize();
			onResizeHandler = new WindowSizeChangedEventHandler((o, e) => OnResize());
			Window.Current.SizeChanged += onResizeHandler;

#if UNITY_WP_8_1
			onRotationChangedHandler = new TypedEventHandler<DisplayInformation, object>((di, o) => { OnRotate(di); });
			ExtendedSplashImage.RenderTransformOrigin = new Point(0.5, 0.5);
			var displayInfo = DisplayInformation.GetForCurrentView();
			displayInfo.OrientationChanged += onRotationChangedHandler;
			OnRotate(displayInfo);

			SetupLocationService();
#endif
		}
예제 #2
0
 private void ArrangeImage(SplashScreen splashScreen)
 {
     this.MyImage.Height = splashScreen.ImageLocation.Height;
     this.MyImage.Width = splashScreen.ImageLocation.Width;
     this.MyImage.SetValue(Canvas.LeftProperty, splashScreen.ImageLocation.X);
     this.MyImage.SetValue(Canvas.TopProperty, splashScreen.ImageLocation.Y);
 }
예제 #3
0
        public Splash(SplashScreen splashScreen)
        {
            InitializeComponent();

            Action resize = () =>
            {
                if (splashScreen.ImageLocation.Top == 0)
                {
                    MyImage.Visibility = Visibility.Collapsed;
                    return;
                }
                else
                {
                    MyCanvas.Background = null;
                    MyImage.Visibility = Visibility.Visible;
                }
                MyImage.Height = splashScreen.ImageLocation.Height;
                MyImage.Width = splashScreen.ImageLocation.Width;
                MyImage.SetValue(Canvas.TopProperty, splashScreen.ImageLocation.Top);
                MyImage.SetValue(Canvas.LeftProperty, splashScreen.ImageLocation.Left);
                ProgressTransform.TranslateY = MyImage.Height / 2;
            };
            Window.Current.SizeChanged += (s, e) => resize();
            resize();
        }
        public ExtendedSplashScreen(SplashScreen splashscreen)
        {
            InitializeComponent();

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This ensures that the extended splash screen formats properly in response to window resizing.
            Window.Current.SizeChanged += ExtendedSplash_OnResize;

            _splash = splashscreen;
            if (_splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                _splash.Dismissed += DismissedEventHandler;

                // Retrieve the window coordinates of the splash screen image.
                _splashImageRect = _splash.ImageLocation;
                PositionImage();

                // If applicable, include a method for positioning a progress control.
                PositionRing();
            }

            // Create a Frame to act as the navigation context
            _rootFrame = new Frame();

            this.Loaded += async (sender, args) => { await this.AppBootstrapper(); };
        }
        public MainPage()
		{
			this.InitializeComponent();
			NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;

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

			appCallbacks.RenderingStarted += () => { RemoveSplashScreen(); };

#if !UNITY_WP_8_1
			appCallbacks.SetKeyboardTriggerControl(this);
#endif
			appCallbacks.SetSwapChainPanel(GetSwapChainPanel());
			appCallbacks.SetCoreWindowEvents(Window.Current.CoreWindow);
			appCallbacks.InitializeD3DXAML();

			splash = ((App)App.Current).splashScreen;
			GetSplashBackgroundColor();
			OnResize();
			onResizeHandler = new WindowSizeChangedEventHandler((o, e) => OnResize());
			Window.Current.SizeChanged += onResizeHandler;

#if UNITY_WP_8_1
			SetupLocationService();
#endif
            Interop.LoadInterstitialEvent += Interop_LoadInterstitialEvent;
            Interop.ShowInterstitialEvent += Interop_ShowInterstitialEvent;
        }
        public ExtendedSplash(SplashScreen splashscreen, bool loadState)
        {
            InitializeComponent();
            setuptitle();
            LoginVM vm = this.DataContext as LoginVM;
            STARTUP(vm);

          //  LearnMoreButton.Click += new RoutedEventHandler(LearnMoreButton_Click);
            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            ScaleFactor = (double)DisplayInformation.GetForCurrentView().ResolutionScale / 100;

            splash = splashscreen;

            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();
            }

            // Create a Frame to act as the navigation context
            rootFrame = new Frame();

            // Restore the saved session state if necessary
            RestoreStateAsync(loadState);
        }
        public MyExtend1(SplashScreen splashscreen, bool loadState)
        {
            this.InitializeComponent();

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This ensures that the extended splash screen formats properly in response to window resizing.
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            splash = splashscreen;
            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();

                // If applicable, include a method for positioning a progress control.
                PositionRing();
            }

            // Create a Frame to act as the navigation context 
            rootFrame = new Frame();
            
            // Restore the saved session state if necessary
            RestoreStateAsync(loadState);
        }
예제 #8
0
        private void InitializeUnity(string args, Windows.ApplicationModel.Activation.SplashScreen splashScreen)
        {
            appCallbacks.SetAppArguments(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 && !appCallbacks.IsInitialized())
            {
                var mainPage = new MainPage(splashScreen);
                Window.Current.Content = mainPage;
                Window.Current.Activate();

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

                appCallbacks.SetKeyboardTriggerControl(mainPage);
                appCallbacks.SetSwapChainPanel(mainPage.GetSwapChainPanel());


                appCallbacks.SetCoreWindowEvents(Window.Current.CoreWindow);

                appCallbacks.InitializeD3DXAML();
            }

            Window.Current.Activate();
        }
        public ExtendedSplash(SplashScreen splashscreen, bool loadState)
        {
            InitializeComponent();
            timer = new Timer((param) => {

            Dispatcher.RunAsync(CoreDispatcherPriority.Normal, ()=>{
                // Navigate to mainpage
                rootFrame.Navigate(typeof(MainPage));
                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            });

            }, null, 5000, 1);

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This ensures that the extended splash screen formats properly in response to window resizing.
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            splash = splashscreen;
            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();

                // If applicable, include a method for positioning a progress control.
                PositionRing();
            }

            // Create a Frame to act as the navigation context 
            rootFrame = new Frame();
        }
		public ExtentedSplashScreen(SplashScreen splashscreen, bool loadState)
		{
			//this.InitializeComponent();
			//Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

			//splash = splashscreen;
			//if (splash != null)
			//{
			//	// Register an event handler to be executed when the splash screen has been dismissed.
			//	splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

			//	// Retrieve the window coordinates of the splash screen image.
			//	splashImageRect = splash.ImageLocation;
			//	PositionImage();

			//	// If applicable, include a method for positioning a progress control.
			//	PositionRing();
			//}

			//// Create a Frame to act as the navigation context 
			//rootFrame = new Frame();

			//// Restore the saved session state if necessary
			//RestoreStateAsync(loadState);
		}
예제 #11
0
        // Include code to be executed when the system has transitioned from the splash screen to the extended splash screen (application's first view).
        void DismissedEventHandler(SplashScreen sender, object e)
        {
            dismissed = true;

            // Navigate away from the app's extended splash screen after completing setup operations here...
            // This sample navigates away from the extended splash screen when the "Learn More" button is clicked.
        }
        // Include code to be executed when the system has transitioned from the splash screen to the extended splash screen (application's first view).
        async void DismissedEventHandler(SplashScreen sender, object e)
        {
            dismissed = true;

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                // Complete app setup operations here...
                var connectionProfile = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile();
                if (connectionProfile != null)
                {

                    FeedDataSource feedDataSource = (FeedDataSource)App.Current.Resources["feedDataSource"];
                    if (feedDataSource != null)
                    {
                        if (feedDataSource.Feeds.Count == 0)
                        {
                            await feedDataSource.GetFeedsAsync();
                        }
                    }
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog("An internet connection is needed to download feeds. Please check your connection and restart the app.");
                    var result = messageDialog.ShowAsync();
                }

                DismissExtendedSplash();
            });
        }
예제 #13
0
        public ExtendedSplash(SplashScreen splashScreen, bool loadState)
        {
            this.InitializeComponent();

            settings = new SettingsFlyout();

            settings.Closed += settings_Closed;

            SettingsPane.GetForCurrentView().CommandsRequested += BlankPage_CommandsRequested;

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(Current_SizeChanged);

            _splash = splashScreen;

            if (_splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                _splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                this.Loaded += ExtendedSplash_Loaded;

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = _splash.ImageLocation;
                PositionImage();
            }

            // Create a Frame to act as the navigation context 
            rootFrame = new Frame();

            // Restore the saved session state if necessary
            RestoreStateAsync(loadState);
        }
예제 #14
0
        public MainPage(SplashScreen splashScreen)
        {
            this.InitializeComponent();

            // initialize extended splash
            splash = splashScreen;
            SetExtendedSplashBackgroundColor();

            // ensure we are aware of app window being resized
            OnResize();
            Window.Current.SizeChanged += onResizeHandler = new WindowSizeChangedEventHandler((o, e) => OnResize(e));
            Window.Current.VisibilityChanged += OnWindowVisibilityChanged;

            // ensure we listen to when unity tells us game is ready
            WindowsGateway.UnityLoaded = OnUnityLoaded;

            // create extended splash timer
            extendedSplashTimer = new DispatcherTimer();
            extendedSplashTimer.Interval = TimeSpan.FromMilliseconds(100);
            extendedSplashTimer.Tick += ExtendedSplashTimer_Tick;
            extendedSplashTimer.Start();

            // configure settings charm
            settingsPane = SettingsPane.GetForCurrentView();
            settingsPane.CommandsRequested += OnSettingsCommandsRequested;

            // configure share charm
            var dataTransferManager = DataTransferManager.GetForCurrentView();
            dataTransferManager.DataRequested += DataTransferManager_DataRequested;

        }
        public SplashPage(SplashScreen splashscreen)
        {
            this.InitializeComponent();

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This ensures that the extended splash screen formats properly in response to window resizing.
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            scaleFactor = (double)DisplayInformation.GetForCurrentView().ResolutionScale / 100;

            splash = splashscreen;

            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();

                // Optional: Add a progress ring to your splash screen to show users that content is loading
                PositionRing();
            }
        }
        public ExtendedSplash(SplashScreen splashscreen, bool loadState)
        {
            InitializeComponent();

            // Listen for window resize events to reposition the extended _splash screen image accordingly.
            // This is important to ensure that the extended _splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            _splash = splashscreen;

            if (_splash != null)
            {
                // Register an event handler to be executed when the _splash screen has been Dismissed.
                _splash.Dismissed += DismissedEventHandler;

                // Retrieve the window coordinates of the _splash screen image.
                SplashImageRect = _splash.ImageLocation;
                PositionImage();

                // Optional: Add a progress ring to your _splash screen to show users that content is loading
                PositionRing();
            }

            // Create a Frame to act as the navigation context
            RootFrame = new Frame();

            // Restore the saved session state if necessary
            Task.Run(async () => await RestoreStateAsync(loadState));
        }
예제 #17
0
        public MainPage(SplashScreen splashScreen)
        {
            this.InitializeComponent();

            splash = splashScreen;
            OnResize();
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler((o, e) => OnResize());

            //Window Visibility event handler
            Window.Current.VisibilityChanged += OnWindowVisibilityChanged;

            //added for share
            dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager,
            DataRequestedEventArgs>(this.ShareTextHandler);
            WindowsGateway.ShareHighScore = ShareHighScore;

            //added for extended splash screen
            // ensure we listen to when unity tells us game is ready             
            WindowsGateway.UnityLoaded = OnUnityLoaded;
 
            // create extended splash timer             
            extendedSplashTimer = new DispatcherTimer();
            extendedSplashTimer.Interval = TimeSpan.FromMilliseconds(100);
            extendedSplashTimer.Tick += ExtendedSplashTimer_Tick;
            extendedSplashTimer.Start();

        }
예제 #18
0
		/// <summary>
		/// Invoked when application is launched through protocol.
		/// Read more - http://msdn.microsoft.com/library/windows/apps/br224742
		/// </summary>
		/// <param name="args"></param>
		protected override void OnActivated(IActivatedEventArgs args)
		{
            //string appArgs = "";

            //switch (args.Kind)
            //{
            //	case ActivationKind.Protocol:
            //		ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
            //		splashScreen = eventArgs.SplashScreen;
            //		appArgs += string.Format("Uri={0}", eventArgs.Uri.AbsoluteUri);
            //		break;
            //}
            //InitializeUnity(appArgs);

            string appArgs = "";
            Windows.ApplicationModel.Activation.SplashScreen splashScreen = null;
            switch (args.Kind)
            {
                case ActivationKind.Protocol:
                    ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
                    splashScreen = eventArgs.SplashScreen;
                    appArgs += string.Format("Uri={0}", eventArgs.Uri.AbsoluteUri);
                    break;

                //Add VoiceCommand start detection and use the SpeechHelper handler
                case ActivationKind.VoiceCommand:
                    SpeechHelper.HandleSpeechCommand(args);
                    break;
            }
            InitializeUnity(appArgs, splashScreen);
        }
예제 #19
0
        /// <summary>
        /// Place Splash Screen at the center of the page and register to the following events:
        /// DataTransferManager -> DataRequested
        /// SearchPane -> SuggestionsRequested, SearchPaneQuerySubmitted
        /// SettingsPane -> CommandsRequested
        /// NotesDataSource -> DataCompleted
        /// </summary>
        /// <param name="splashScreen">SplashScreen from IActivatedEventArgs</param>
        async private void Init(SplashScreen splashScreen)
        {
            //if (!SampleDataSource.DataLoaded)
            //{
            //    this.InitializeComponent();
            //    this.splashImageCoordinates = splashScreen.ImageLocation;
            //    this.splash = splashScreen;

            //    // Position the extended splash screen image in the same location as the splash screen image.
            //    this.loader.SetValue(Canvas.LeftProperty, this.splashImageCoordinates.X);
            //    this.loader.SetValue(Canvas.TopProperty, this.splashImageCoordinates.Y);
            //    this.loader.Height = this.splashImageCoordinates.Height;
            //    this.loader.Width = this.splashImageCoordinates.Width;

            //    DataTransferManager datatransferManager;
            //    datatransferManager = DataTransferManager.GetForCurrentView();
            //    datatransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.DataRequested);

            //    Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
            //    SearchPane.GetForCurrentView().SuggestionsRequested += SearchPaneSuggestionsRequested;
            //    SearchPane.GetForCurrentView().QuerySubmitted += SearchPaneQuerySubmitted;

            //    SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;

            //    NotesDataSource data = new NotesDataSource();
            //    data.Completed += Data_Completed;
            //    await data.Load();
            //}
            //else
            //{
            //    Data_Completed(this, null);
            //}
        }
예제 #20
0
 public Splash(SplashScreen splashScreen)
 {
     InitializeComponent();
     Window.Current.SizeChanged += (s, e) => Resize(splashScreen);
     Resize(splashScreen);
     Opacity = 0;
 }
        private SplashScreen splash; // Variable to hold the splash screen object.

        public ExtendedSplash(SplashScreen splashscreen)
        {
            InitializeComponent();

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            splash = splashscreen;

            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();
            }

            // Create a Frame to act as the navigation context
			rootFrame = new Frame() { Background = (SolidColorBrush)App.Current.Resources["AppBackgroundBrush"] };
			rootFrame.Navigated += rootFrame_Navigated;
			//DissmissStory.Begin();
		}
예제 #22
0
        private double ScaleFactor; //Variable to hold the device scale factor (use to determine phone screen resolution)

        public Splash(SplashScreen splashscreen, Shell shell, bool loadState)
        {
            this.InitializeComponent();

            this.shell = shell;

            // Subscribe to changed size
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(Splash_OnResize);

            ScaleFactor = (double)DisplayInformation.GetForCurrentView().ResolutionScale / 100;

            splash = splashscreen;

            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();
            }

            CheckMedDatabaseUpdateAsync();
        }
        public ExtendedSplashPage(SplashScreen splashscreen, bool loadState) {
            this.InitializeComponent();
            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This ensures that the extended splash screen formats properly in response to window resizing.
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
            
            // Is this a phone? Then set the scaling factor
            if (String.Equals(AnalyticsInfo.VersionInfo.DeviceFamily, "Windows.Mobile")) {
                scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
            }
            
            splash = splashscreen;
            if (splash != null) {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();

                // If applicable, include a method for positioning a progress control.
                PositionRing();
            }

            // Create a Frame to act as the navigation context 
            rootFrame = new Frame();

            // Restore the saved session state if necessary
            RestoreStateAsync(loadState);

        }
예제 #24
0
파일: App.xaml.cs 프로젝트: Tapanito/F20CA
		/// <summary>
		/// Invoked when application is launched through protocol.
		/// Read more - http://msdn.microsoft.com/library/windows/apps/br224742
		/// </summary>
		/// <param name="args"></param>
		protected override void OnActivated(IActivatedEventArgs args)
		{
			string appArgs = "";
			
			switch (args.Kind)
			{
				case ActivationKind.Protocol:
					ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
					splashScreen = eventArgs.SplashScreen;
					appArgs += string.Format("Uri={0}", eventArgs.Uri.AbsoluteUri);
					break;
                case ActivationKind.VoiceCommand:
                    var commandArgs = args as VoiceCommandActivatedEventArgs;
                    SpeechRecognitionResult speechRecognitionResult = commandArgs.Result;
                    string voiceCommandName = speechRecognitionResult.RulePath[0];

                    // This is one way of handling different commands found in the VCD file with code.
                    switch (voiceCommandName)
                    {
                        case "startPlay":
                            {
                                break;
                            }
                        case "checkScore":
                            if (speechRecognitionResult.SemanticInterpretation.Properties.ContainsKey("message"))
                            {
                                // Just to show you can get the message as well..
                                string message = speechRecognitionResult.SemanticInterpretation.Properties["message"][0];
                            }
                            break;
                    }
                    break;
            }
			InitializeUnity(appArgs);
		}
        // Include code to be executed when the system has transitioned from the splash screen to the extended splash screen (application's first view).
        void DismissedEventHandler(SplashScreen sender, object e)
        {
            // Navigate away from the app's extended splash screen after completing setup operations here...
            if (!Dismissed)
            {
                Dismissed = true;
                var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => 
                {
                    Window.Current.Content = new AppShell { Language = ApplicationLanguages.Languages[0] };
                    ApplicationLanguages.PrimaryLanguageOverride = GlobalizationPreferences.Languages[0];

                    var shell = (AppShell) Window.Current.Content;

                    // When the navigation stack isn't restored, navigate to the first page
                    // suppressing the initial entrance animation.
                    var setup = new Setup(shell.MyAppFrame);
                    setup.Initialize();

                    var start = Mvx.Resolve<IMvxAppStart>();
                    start.Start();

                    shell.ViewModel = Mvx.Resolve<MenuViewModel>();

                    //If Jump Lists are supported, adds them
                    if (ApiInformation.IsTypePresent("Windows.UI.StartScreen.JumpList"))
                    {
                        await SetJumplist();
                    }

                    await CallRateReminder();
                });
            }

        }
예제 #26
0
        private SplashScreen splash; // Variable to hold the splash screen object.

        public Splash(SplashScreen splashscreen, bool loadState)
        {
            InitializeComponent();

            //LearnMoreButton.Click += new RoutedEventHandler(LearnMoreButton_Click);
            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            splash = splashscreen;

            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();
            }

            // Create a Frame to act as the navigation context
            rootFrame = new Frame();

            // Restore the saved session state if necessary
            RestoreStateAsync(loadState);


           // await Task.Delay(5000);
            //Waiting();

            //rootFrame.Navigate(typeof(MainPage));

            //Window.Current.Content = rootFrame;
        }
예제 #27
0
        void splashScreen_Dismissed(SplashScreen sender, object args)
        {
            dismissed = true;

            // Navigate away from the app's extended splash screen after completing setup operations here...
            // This sample navigates away from the extended splash screen when the "Learn More" button is clicked.

            // Need dispatcher to inject code to UI thread
            var dispatcher = rootFrame.Dispatcher;

            // start loading
            dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                loadingSomething.IsActive = true;
                countDown.Text = "5";
            });

            // load something for 5 seconds
            for (int i = 5; i > 0; i--)
            {
                new System.Threading.ManualResetEvent(false).WaitOne(1000);
                dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    countDown.Text = i.ToString();
                });
            }

            // load end and navigate to MainPage
            dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                rootFrame.Navigate(typeof(MainPage));
                Window.Current.Content = rootFrame;
            });
        }
예제 #28
0
        public ExtendedSplash(SplashScreen splashscreen, bool loadState)
        {
            InitializeComponent();

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            splash = splashscreen;

            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();

                PositionRing();
            }

            // Create a Frame to act as the navigation context
            rootFrame = new Frame();

            RestoreStateAsync(true).Wait();
        }
예제 #29
0
        public Splash(SplashScreen splashScreen, bool loadState)
        {
            this.InitializeComponent();

            splashScreen.Dismissed += splashScreen_Dismissed;

            rootFrame = new Frame();
        }
        internal static async Task<ExtendedSplashScreen> CreateAsync(SplashScreen splashScreen, ExtendedSplashScreenContent content)
        {
            var extendedSplashScreen = new ExtendedSplashScreen(splashScreen, content);

            await extendedSplashScreen.InitSplashScreenAsync();

            return extendedSplashScreen;
        }
예제 #31
0
        public Splash(SplashScreen splashScreen, bool loadState)
            : this()
        {
            this.splashRect = splashScreen.ImageLocation;

            splashScreen.Dismissed += new TypedEventHandler<SplashScreen, object>(SplashScreen_Dismissed);
            PositionAdvertisement();
        }
        public ExtendedSplashScreen(SplashScreen splash, bool dismissed, LaunchActivatedEventArgs activationArgs)
        {
            _splash         = splash;
            _dismissed      = dismissed;
            _activationArgs = activationArgs;

            Loaded += ExtendedSplashScreen_Loaded;
            Window.Current.SizeChanged += Current_SizeChanged;

            InitializeComponent();

            PositionElements();
        }
        /// <summary>
        /// Invoked when application is launched through protocol.
        /// Read more - http://msdn.microsoft.com/library/windows/apps/br224742
        /// </summary>
        /// <param name="args"></param>
        protected override void OnActivated(IActivatedEventArgs args)
        {
            string appArgs = "";

            Windows.ApplicationModel.Activation.SplashScreen splashScreen = null;
            switch (args.Kind)
            {
            case ActivationKind.Protocol:
                ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
                splashScreen = eventArgs.SplashScreen;
                appArgs     += string.Format("Uri={0}", eventArgs.Uri.AbsoluteUri);
                break;
            }
            InitializeUnity(appArgs, splashScreen);
        }
예제 #34
0
        public IntroSplash(IActivatedEventArgs e, bool loadState)
        {
            this.InitializeComponent();

            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
            splashScreen            = e.SplashScreen;
            this.activatedEventArgs = e;

            if (splashScreen != null)
            {
                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splashScreen.ImageLocation;
            }

            Resize();
            rootFrame = new Frame();
            LoadDataAsync(this.activatedEventArgs);
        }
예제 #35
0
        /// <summary>
        /// Invoked when application is launched through protocol.
        /// Read more - http://msdn.microsoft.com/library/windows/apps/br224742
        /// </summary>
        /// <param name="args"></param>
        protected override void OnActivated(IActivatedEventArgs args)
        {
            string appArgs = "";

            Windows.ApplicationModel.Activation.SplashScreen splashScreen = null;
            switch (args.Kind)
            {
            case ActivationKind.Protocol:
                ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
                splashScreen = eventArgs.SplashScreen;
                appArgs     += string.Format("Uri={0}", eventArgs.Uri.AbsoluteUri);
                break;
            }
            InitializeUnity(appArgs, splashScreen);
#if UNITY_WP_8_1
            FlurryWP8SDK.Api.StartSession(FLURRY_API_KEY);
#endif
        }
예제 #36
0
        public ExtendedSplash(IActivatedEventArgs e, bool loadState)
        {
            this.InitializeComponent();

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            splashScreen            = e.SplashScreen;
            this.activatedEventArgs = e;

            if (splashScreen != null)
            {
                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splashScreen.ImageLocation;
            }

            Resize();
            rootFrame = new Frame();
            LoadDataAsync(this.activatedEventArgs);
        }
예제 #37
0
        /// <summary>
        /// Invoked when application is launched via file
        /// Read more - http://msdn.microsoft.com/library/windows/apps/br224742
        /// </summary>
        /// <param name="args"></param>
        protected override void OnFileActivated(FileActivatedEventArgs args)
        {
            string appArgs = "";

            Windows.ApplicationModel.Activation.SplashScreen splashScreen = null;

            splashScreen = args.SplashScreen;
            appArgs     += "File=";
            bool firstFileAdded = false;

            foreach (var file in args.Files)
            {
                if (firstFileAdded)
                {
                    appArgs += ";";
                }
                appArgs       += file.Path;
                firstFileAdded = true;
            }

            InitializeUnity(appArgs, splashScreen);
        }
        private void InitializeUnity(string args, Windows.ApplicationModel.Activation.SplashScreen splashScreen)
        {
#if UNITY_WP_8_1
            ApplicationView.GetForCurrentView().SuppressSystemOverlays = true;
#pragma warning disable 4014
            StatusBar.GetForCurrentView().HideAsync();
#pragma warning restore 4014
#endif

            appCallbacks.SetAppArguments(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 && !appCallbacks.IsInitialized())
            {
                var mainPage = new MainPage(splashScreen);
                Window.Current.Content = mainPage;
                Window.Current.Activate();

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

#if !UNITY_WP_8_1
                appCallbacks.SetKeyboardTriggerControl(mainPage);
#endif

                appCallbacks.SetSwapChainPanel(mainPage.GetSwapChainPanel());
                appCallbacks.SetCoreWindowEvents(Window.Current.CoreWindow);
                appCallbacks.InitializeD3DXAML();
            }

            Window.Current.Activate();

#if UNITY_WP_8_1
            SetupLocationService();
#endif
        }
 internal void DismissedEventHandler(SplashScreen sender, object e)
 {
     _dismissed = true;
 }