当前位置: 首页>>代码示例>>C#>>正文


C# UIWindow类代码示例

本文整理汇总了C#中UIWindow的典型用法代码示例。如果您正苦于以下问题:C# UIWindow类的具体用法?C# UIWindow怎么用?C# UIWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UIWindow类属于命名空间,在下文中一共展示了UIWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size
            MainWindow = new UIWindow(UIScreen.MainScreen.Bounds);

            var currentHomeUiViewController = new SplashViewController();
            RootNavigationController = new UINavigationController(currentHomeUiViewController);
            MainWindow.RootViewController = RootNavigationController;

            var titleTextAttributes = new UITextAttributes();
            titleTextAttributes.TextColor = UIColor.FromRGB(25, 83, 135);
            titleTextAttributes.TextShadowColor = UIColor.Clear;
            titleTextAttributes.Font = UIFont.SystemFontOfSize(16);

            //			if (IsIOS5OrGreater)
            //			{
            //				UINavigationBar.Appearance.SetTitleTextAttributes(titleTextAttributes);
            //				UINavigationBar.Appearance.SetBackgroundImage(UIImage.FromBundle("/Images/top_bar_bg"), UIBarMetrics.Default);
            //			}
            //

            MainWindow.MakeKeyAndVisible();

            return true;
        }
开发者ID:mattkrebs,项目名称:RBAListDemo,代码行数:32,代码来源:AppDelegate.cs

示例2: OnSetupWindow

 protected virtual void OnSetupWindow()
 {
     UIWindow window = new UIWindow(UIScreen.MainScreen.Bounds);
     window.RootViewController = NavigationController;
     window.MakeKeyAndVisible();
     var result = _navigationProvider.NavigateAsync(MainPageViewModelType);
 }
开发者ID:ryanhorath,项目名称:Rybird.Framework,代码行数:7,代码来源:iOSApp.cs

示例3: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			Forms.Init ();


			// http://forums.xamarin.com/discussion/21148/calabash-and-xamarin-forms-what-am-i-missing
			Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => {

				// http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/
				if (null != e.View.StyleId) {
					e.NativeView.AccessibilityIdentifier = e.View.StyleId;
					Console.WriteLine("Set AccessibilityIdentifier: " + e.View.StyleId);
				}
			};


			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			window.RootViewController = App.GetMainPage ().CreateViewController ();
			window.MakeKeyAndVisible ();


			#if DEBUG
			// requires Xamarin Test Cloud Agent component
			Xamarin.Calabash.Start();
			#endif


			return true;
		}
开发者ID:ZaK14120,项目名称:xamarin-forms-samples,代码行数:30,代码来源:AppDelegate.cs

示例4: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create our window
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			
			// are we running an iPhone or an iPad?
			DetermineCurrentDevice ();

			// instantiate our main navigatin controller and add it's view to the window
			mainNavController = new UINavigationController ();
			
			switch (CurrentDevice)
			{
				case DeviceType.iPhone:
					iPhoneHome = new HandlingRotation.Screens.iPhone.Home.HomeScreen ();
					mainNavController.PushViewController (iPhoneHome, false);
					break;
				
				case DeviceType.iPad:
					iPadHome = new HandlingRotation.Screens.iPad.Home.HomeScreenPad ();
					mainNavController.PushViewController (iPadHome, false);
					break;
			}

			window.RootViewController = mainNavController;

			return true;
		}
开发者ID:7sharp9,项目名称:monotouch-samples,代码行数:29,代码来源:AppDelegate.cs

示例5: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackTranslucent;
            viewController = new FlyOutNavigationController ();
            viewController.NavigationRoot = new RootElement ("")
            {
                new Section ("Section 1"){
                    new StringElement ("View 1"),
                    new ImageStringElement("View 2",UIImage.FromFile("jhill.jpeg")),
                    new StringElement ("View 3"),
                },
                new Section ("Section 2"){
                    new StringElement ("View 1"),
                    new StringElement ("View 2"),
                }
            };
            viewController.ViewControllers = new UIViewController[]{
                 new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 1")}}))
                ,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 2")}}))
                ,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 3")}}))
                ,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 2"){new Section (){new StringElement ("View 1")}}))
                ,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 2"){new Section (){new StringElement ("View 2")}}))
            };
            window.RootViewController = viewController;
            window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:TheGiant,项目名称:FlyOutNavigation,代码行数:36,代码来源:AppDelegate.cs

示例6: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            //
            // ENTER YOUR LICENSE INFO HERE
            //
            PXEngine.LicenseKeyForUser("SERIAL NUMBER", "USER NAME");

            // create a new window instance based on the screen size
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            window.RootViewController = new MyViewController();

            // make the window visible
            window.MakeKeyAndVisible ();

            PXEngine shared = PXEngine.SharedInstance();

            // Print the version an build date
            Console.WriteLine("Pixate Engine v{0} {1}", shared.Version, shared.BuildDate);

            // Print the location of the current application-level stylesheet
            Console.WriteLine("CSS File location: {0}", PXStylesheet.CurrentApplicationStylesheet().FilePath);

            // Monitor for changes in the stylesheet and update styles live
            PXStylesheet.CurrentApplicationStylesheet().MonitorChanges = true;

            return true;
        }
开发者ID:stefandevo,项目名称:MonoTouch-Pixate,代码行数:35,代码来源:AppDelegate.cs

示例7: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            viewController = new UINavigationController ();
            viewController.PushViewController(new MainScreenGroup(), true);
            viewController.NavigationBar.Opaque = true;

            window.MakeKeyAndVisible ();

            #if LITE
            AdManager.LoadBanner();
            #endif

            // On iOS5 we use the new window.RootViewController, on older versions, we add the subview
            if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
                window.RootViewController = viewController;
            else
                window.AddSubview (viewController.View);

            #if LITE
            Apprater = new Appirater(527002436);
            #else
            Apprater = new Appirater(526844540);
            #endif
            Apprater.AppLaunched();
            return true;
        }
开发者ID:zekiller3,项目名称:SMSParty,代码行数:35,代码来源:AppDelegate.cs

示例8: FinishedLaunching

		//
		// This method is invoked when the application has loaded and is ready to run. In this 
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			var root = new RootElement("MBProgressHUD")
			{
				new Section ("Samples")
				{
					new StringElement ("Simple indeterminate progress", ShowSimple),
					new StringElement ("With label", ShowWithLabel),
					new StringElement ("With details label", ShowWithDetailsLabel),
					new StringElement ("Determinate mode", ShowWithLabelDeterminate),
					new StringElement ("Annular determinate mode", ShowWIthLabelAnnularDeterminate),
					new StringElement ("Custom view", ShowWithCustomView),
					new StringElement ("Mode switching", ShowWithLabelMixed),
					new StringElement ("Using handlers", ShowUsingHandlers),
					new StringElement ("On Window", ShowOnWindow),
					new StringElement ("NSURLConnection", ShowUrl),
					new StringElement ("Dim background", ShowWithGradient),
					new StringElement ("Text only", ShowTextOnly),
					new StringElement ("Colored", ShowWithColor),
				}
			};

			dvcDialog = new DialogViewController(UITableViewStyle.Grouped, root, false);
			navController = new UINavigationController(dvcDialog);

			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:JonathanTLH,项目名称:PanTiltZoomSystem,代码行数:39,代码来源:AppDelegate.cs

示例9: InitPanoramaSample

        private void InitPanoramaSample()
        {
            this.window = new UIWindow(UIScreen.MainScreen.Bounds);

            this.window.RootViewController = new TestPanorama();
            this.window.MakeKeyAndVisible();
        }
开发者ID:utahking,项目名称:MonoKit,代码行数:7,代码来源:AppDelegate.cs

示例10: MXTouchContainer

        private MXTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
            : base(theApp, appDelegate, window)
        {
            touchNavigation = new MXTouchNavigation(appDelegate, window);

            ViewGroups = new List<MXTouchViewGroup>();
        }
开发者ID:technohead,项目名称:MonoCross,代码行数:7,代码来源:MXTouchContainer.cs

示例11: FinishedLaunching

		public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
		{
			// Override point for customization after application launch.
			// If not required for your application you can safely delete this method

			// Code to start the Xamarin Test Cloud Agent
			#if ENABLE_TEST_CLOUD
			Xamarin.Calabash.Start();
			#endif

			Window = new UIWindow (UIScreen.MainScreen.Bounds);

			application.StatusBarHidden = true;
			application.ApplicationSupportsShakeToEdit = true;

			var path = NSBundle.MainBundle.PathForResource("appdata", "json");
			var json = File.ReadAllText (path);
			var data = Newtonsoft.Json.JsonConvert.DeserializeObject<AppData>(json);

			Window.BackgroundColor = UIColor.White;
			_tabViewController = new FlashCardSetTabViewController (data);
			Window.RootViewController = _tabViewController;

			Window.MakeKeyAndVisible ();

			return true;
		}
开发者ID:funhead,项目名称:baby-flashcard-app,代码行数:27,代码来源:AppDelegate.cs

示例12: LoginPageRenderer

        public LoginPageRenderer()
        {
            dialog = new DialogViewController(new RootElement("Login"));

            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.RootViewController = new UINavigationController(dialog);
            window.MakeKeyAndVisible();

            if (App.IsGoogleLogin && !App.IsLoggedIn)
            {
                var myAuth = new GoogleAuthenticator("730990345527-h7r23gcdmdllgke4iud4di76b0bmpnbb.apps.googleusercontent.com",
                    "https://www.googleapis.com/auth/userinfo.email",
                    "https://accounts.google.com/o/oauth2/auth",
                    "https://www.googleapis.com/plus/v1/people/me");
				UIViewController vc = myAuth.authenticator.GetUI();

                myAuth.authenticator.Completed += async (object sender, AuthenticatorCompletedEventArgs eve) =>
                {
                    //dialog.DismissViewController(true, null);
                    window.Hidden = true;
                    dialog.Dispose();
                    window.Dispose();
                    if (eve.IsAuthenticated)
                    {
                        var user = await myAuth.GetProfileInfoFromGoogle(eve.Account.Properties["access_token"].ToString());
						await App.SaveUserData(user,true);
						//dialog.DismissViewController(true, null);
						App.IsLoggedIn = true;
						App.SuccessfulLoginAction.Invoke();
                    }
                };

                dialog.PresentViewController(vc, true, null);
            }
        }
开发者ID:praveenmohanmm,项目名称:PurposeColor_Bkp_Code,代码行数:35,代码来源:LoginPageRenderer.cs

示例13: FinishedLaunching

    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        UIApplication.SharedApplication.StatusBarHidden = true;

        image = new UIImageView (UIScreen.MainScreen.Bounds) {
            Image = UIImage.FromFile ("Background.png")
        };
        text = new UITextField (new RectangleF (44, 32, 232, 31)) {
            BorderStyle = UITextBorderStyle.RoundedRect,
            TextColor = UIColor.Black,
            BackgroundColor = UIColor.Black,
            ClearButtonMode = UITextFieldViewMode.WhileEditing,
            Placeholder = "Hello world",
        };
        text.ShouldReturn = delegate (UITextField theTextfield) {
            text.ResignFirstResponder ();

            label.Text = text.Text;
            return true;
        };

        label = new UILabel (new RectangleF (20, 120, 280, 44)){
            TextColor = UIColor.Gray,
            BackgroundColor = UIColor.Black,
            Text = text.Placeholder
        };

        var vc = new ViewController (this) { image, text, label };

        window = new UIWindow (UIScreen.MainScreen.Bounds){ vc.View };

        window.MakeKeyAndVisible ();

        return true;
    }
开发者ID:CVertex,项目名称:monotouch-samples,代码行数:35,代码来源:hello.cs

示例14: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			runner = new TouchRunner (window);

			// tests can be inside the main assembly
			runner.Add (Assembly.GetExecutingAssembly ());
#if false
			// you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
			runner.Writer = new TcpTextWriter ("10.0.1.2", 16384);
			// start running the test suites as soon as the application is loaded
			runner.AutoStart = true;
			// crash the application (to ensure it's ended) and return to springboard
			runner.TerminateAfterExecution = true;
#endif
#if false
			// you can get NUnit[2-3]-style XML reports to the console or server like this
			// replace `null` (default to Console.Out) to a TcpTextWriter to send data to a socket server
			// replace `NUnit2XmlOutputWriter` with `NUnit3XmlOutputWriter` for NUnit3 format
			runner.Writer = new NUnitOutputTextWriter (runner, null, new NUnitLite.Runner.NUnit2XmlOutputWriter ());
			// the same AutoStart and TerminateAfterExecution can be used for build automation
#endif
			window.RootViewController = new UINavigationController (runner.GetViewController ());
			window.MakeKeyAndVisible ();
			return true;
		}
开发者ID:couchbasedeps,项目名称:Touch.Unit,代码行数:26,代码来源:AppDelegate.cs

示例15: FinishedLaunching

 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     Window = new UIWindow (UIScreen.MainScreen.Bounds);
     Window.RootViewController = new ViewController ();
     Window.MakeKeyAndVisible ();
     return true;
 }
开发者ID:GSerjo,项目名称:monotouch-samples,代码行数:7,代码来源:AppDelegate.cs


注:本文中的UIWindow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。