Exemplo n.º 1
0
        public UniversalWindowsPlatform(
            XamlApplication xamlApplication)
        {
            if (null == xamlApplication)
            {
                throw new ArgumentNullException(nameof(xamlApplication));
            }

            this._xamlApplication = xamlApplication;
        }
Exemplo n.º 2
0
        public ApplicationRenderer(
            XForms.Application application,
            XamlApplication xamlApplication)
        {
            if (null == application)
            {
                throw new ArgumentNullException(nameof(application));
            }

            if (null == xamlApplication)
            {
                throw new ArgumentNullException(nameof(xamlApplication));
            }

            this._application         = application;
            this._applicationDelegate = application;
            this._xamlApplication     = xamlApplication;

            // Handle lifetime events
            if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3, 0))
            {
                xamlApplication.EnteredBackground += Application_EnteredBackground;
                xamlApplication.LeavingBackground += Application_LeavingBackground;
            }
            else
            {
                xamlApplication.Suspending += Application_Suspending;
                xamlApplication.Resuming   += Application_Resuming;
            }

            // Handle the back button
            var systemNavigationView = SystemNavigationManager.GetForCurrentView();

            systemNavigationView.BackRequested += SystemNavigationView_BackRequested;

            // Handle the input pane being shown or hidden
            InputPane inputPane = InputPane.GetForCurrentView();

            inputPane.Showing += InputPane_Showing;
            inputPane.Hiding  += InputPane_Hiding;
        }