// // 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 window = new UIWindow (UIScreen.MainScreen.Bounds); MainPageViewController viewController = new MainPageViewController(); //---- instantiate a new navigation controller var rootNavigationController = new UINavigationController(); //---- add the home screen to the navigation controller // (it'll be the top most screen) rootNavigationController.PushViewController(viewController, false); //---- set the root view controller on the window. the nav // controller will handle the rest this.window.RootViewController = rootNavigationController; this.window.MakeKeyAndVisible (); return true; // make the window visible window.MakeKeyAndVisible (); return true; }
public virtual bool WillFinishLaunching (UIApplication application, MonoTouch.Foundation.NSDictionary launchOptions){ UIViewController leftSideDrawerViewController = new MMExampleLeftSideDrawerViewController (); UIViewController centerViewController = new MMExampleCenterTableViewController (); UIViewController rightSideDrawerViewController = new UIViewController ();// new MMExampleRightSideDrawerViewController (); UINavigationController navigationController = new MMNavigationController (); navigationController.ViewControllers = new UIViewController[]{ centerViewController }; navigationController.RestorationIdentifier = "MMExampleCenterNavigationControllerRestorationKey"; UINavigationController leftSideNavController = new MMNavigationController (); leftSideNavController.ViewControllers = new UIViewController[]{ leftSideDrawerViewController }; leftSideNavController.RestorationIdentifier = "MMExampleLeftNavigationControllerRestorationKey"; this.DrawerController = new MMDrawerController.MMDrawerController (); DrawerController.CenterViewController = navigationController; DrawerController.LeftDrawerViewController = leftSideNavController; DrawerController.RestorationIdentifier = "MMDrawer"; DrawerController.MaximumRightDrawerWidth = 200.0F; DrawerController.OpenDrawerGestureModeMask = MMOpenDrawerGestureMode.BezelPanningCenterView; DrawerController.CloseDrawerGestureModeMask = MMCloseDrawerGestureMode.BezelPanningCenterView; //DrawerController.DrawerVisualStateBlock = new Action (DrawerAction (DrawerController, new MMDrawerSide(), 100F)); this.Window = new UIWindow (UIScreen.MainScreen.Bounds); UIColor tintColor = new UIColor (29.0F / 255.0F, 173.0F / 255.0F, 234.0F / 255.0F, 1.0F); this.Window.TintColor = tintColor; this.Window.RootViewController = this.DrawerController; return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); var controller = new UIViewController(); var view = new UIView (UIScreen.MainScreen.Bounds); view.BackgroundColor = UIColor.White; controller.View = view; controller.NavigationItem.Title = "SignalR Client"; var textView = new UITextView(new CGRect(0, 0, 320, view.Frame.Height - 0)); view.AddSubview (textView); navController = new UINavigationController (controller); window.RootViewController = navController; window.MakeKeyAndVisible(); if (SIGNALR_DEMO_SERVER == "http://YOUR-SERVER-INSTANCE-HERE") { textView.Text = "You need to configure the app to point to your own SignalR Demo service. Please see the Getting Started Guide for more information!"; return true; } var traceWriter = new TextViewWriter(SynchronizationContext.Current, textView); var client = new CommonClient(traceWriter); client.RunAsync(SIGNALR_DEMO_SERVER); return true; }
// // 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; }
protected virtual void OnSetupWindow() { UIWindow window = new UIWindow(UIScreen.MainScreen.Bounds); window.RootViewController = NavigationController; window.MakeKeyAndVisible(); var result = _navigationProvider.NavigateAsync(MainPageViewModelType); }
public MvxSidebarPresenter(IUIApplicationDelegate applicationDelegate, UIWindow window) : base(applicationDelegate, window) { AddPresentationHintHandler<MvxSidebarActivePanelPresentationHint>(PresentationHintHandler); AddPresentationHintHandler<MvxSidebarPopToRootPresentationHint>(PresentationHintHandler); AddPresentationHintHandler<MvxSidebarResetRootPresentationHint>(PresentationHintHandler); }
public void AddToMainWindow(UIView view) { if (this.Hidden) { _previousKeyWindow = UIApplication.SharedApplication.KeyWindow; this.Alpha = 0.0f; this.Hidden = false; this.UserInteractionEnabled = true; this.MakeKeyWindow(); } if (this.Subviews.Length > 0) { this.Subviews.Last().UserInteractionEnabled = false; } if (BackgroundImage != null) { UIImageView backgroundView = new UIImageView(BackgroundImage); backgroundView.Frame = this.Bounds; backgroundView.ContentMode = UIViewContentMode.ScaleToFill; this.AddSubview(backgroundView); //[backgroundView release]; //[_backgroundImage release]; BackgroundImage = null; } this.StatusBarDidChangeFrame(null); view.AutoresizingMask = UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleTopMargin; this.AddSubview(view); }
// // 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) { Current = this; var log = new LoggerConfiguration().CreateLogger(); log.Information("Loading"); UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent; // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); // If you have defined a view, add it here: // window.RootViewController = navigationController; var rootNavigationController = Utilities.BuildNavigationController(); rootNavigationController.PushViewController(new ViewControllers.Login(), false); window.RootViewController = rootNavigationController; // make the window visible window.MakeKeyAndVisible(); Utilities.SetTintColor(); autoSuspendHelper.FinishedLaunching(app, options); return true; }
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; }
// // 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 window = new UIWindow (UIScreen.MainScreen.Bounds); // load the appropriate UI, depending on whether the app is running on an iPhone or iPad if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { var controller = new RootViewController (); navigationController = new UINavigationController (controller); window.RootViewController = navigationController; } else { var masterViewController = new RootViewController (); var masterNavigationController = new UINavigationController (masterViewController); var detailViewController = new DetailViewController (); var detailNavigationController = new UINavigationController (detailViewController); splitViewController = new UISplitViewController (); splitViewController.WeakDelegate = detailViewController; splitViewController.ViewControllers = new UIViewController[] { masterNavigationController, detailNavigationController }; window.RootViewController = splitViewController; } // make the window visible window.MakeKeyAndVisible (); return true; }
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; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // check is it 64bit or 32bit Console.WriteLine (IntPtr.Size); // Main app do nothing // Go to Photo > Edit then choose PhotoFilter to start app extension window = new UIWindow (UIScreen.MainScreen.Bounds); window.BackgroundColor = UIColor.White; note = new UILabel (); note.Text = "Note that the app in this sample only serves as a host for the extension. To use the sample extension, edit a photo or video using the Photos app, and tap the extension icon"; note.Lines = 0; note.LineBreakMode = UILineBreakMode.WordWrap; var frame = note.Frame; note.Frame = new CGRect (0, 0, UIScreen.MainScreen.Bounds.Width * 0.75f, 0); note.SizeToFit (); window.AddSubview (note); note.Center = window.Center; window.MakeKeyAndVisible (); return true; }
// // 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; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // create our nav controller navController = new UINavigationController (); // create our home controller based on the device if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { homeViewController = new Tasky.Screens.iPhone.Home.controller_iPhone(); } else { // homeViewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null); } // Styling UINavigationBar.Appearance.TintColor = UIColor.FromRGB (38, 117 ,255); // nice blue UITextAttributes ta = new UITextAttributes(); ta.Font = UIFont.FromName ("AmericanTypewriter-Bold", 0f); UINavigationBar.Appearance.SetTitleTextAttributes(ta); ta.Font = UIFont.FromName ("AmericanTypewriter", 0f); UIBarButtonItem.Appearance.SetTitleTextAttributes(ta, UIControlState.Normal); // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
// // 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; }
// // 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 window = new UIWindow (UIScreen.MainScreen.Bounds); InvokeOnMainThread(delegate { TwitterAccount.getAccount(); }); flyoutController = new FlyOutNavigationController(); tl = new Timeline(flyoutController); flyoutController.NavigationRoot = new RootElement("") { new Section("Navigation") { new StringElement("Timeline") } }; flyoutController.ViewControllers = new UIViewController[] { new UINavigationController(tl) }; window.AddSubview(flyoutController.View); // make the window visible window.MakeKeyAndVisible (); return true; }
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; }
// // 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) { var manager = new DBAccountManager (DropboxSyncKey, DropboxSyncSecret); DBAccountManager.SharedManager = manager; // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); window.RootViewController = new UINavigationController (new PlaygroundViewController ()); Task.Factory.StartNew (() => { this.BeginInvokeOnMainThread (() => { var account = DBAccountManager.SharedManager.LinkedAccount; if (account != null) { SetupDropbox (); } else manager.LinkFromController (window.RootViewController); }); }); // make the window visible window.MakeKeyAndVisible (); app.ApplicationSupportsShakeToEdit = true; return true; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); // make the window visible window.MakeKeyAndVisible (); // create our nav controller navController = new UINavigationController (); // create our home controller based on the device if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { homeViewController = new Screens.HomeScreen(); } else { // sample does not contain an iPad UI // homeViewController = new Screens.iPadHomeScreen (); } // push the view controller onto the nav controller and show the window navController.PushViewController(homeViewController, false); window.RootViewController = navController; window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); var sqliteFilename = "TodoSQLite.db3"; string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder string libraryPath = Path.Combine (documentsPath, "..", "Library"); // Library folder var path = Path.Combine(libraryPath, sqliteFilename); // This is where we copy in the prepopulated database Console.WriteLine (path); if (!File.Exists (path)) { File.Copy (sqliteFilename, path); } var plat = new SQLite.Net.Platform.XamarinIOS.SQLitePlatformIOS(); var conn = new SQLite.Net.SQLiteConnection(plat, path); // Set the database connection string App.SetDatabaseConnection (conn); // window.RootViewController = new HybridRazorViewController (); window.RootViewController = new UINavigationController(new NativeListViewController ()); // make the window visible window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { window = new UIWindow (UIScreen.MainScreen.Bounds); MenuViewController menuViewController = new MenuViewController(UITableViewStyle.Grouped); DetailsViewController detailsViewController = new DetailsViewController(); UINavigationController navController = new UINavigationController (detailsViewController); SlideMenuController slideMenuViewController = new SlideMenuController(); slideMenuViewController.SetContentViewController (navController); slideMenuViewController.SetLeftMenuViewController (menuViewController); UINavigationController cont = new UINavigationController (new MenuViewController (UITableViewStyle.Plain)); slideMenuViewController.SetRightMenuViewController (cont); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { slideMenuViewController.WidthOfPortraitContentViewVisible = 300f; slideMenuViewController.WidthOfLandscapeContentViewVisible = 556f; } window.RootViewController = slideMenuViewController; window.BackgroundColor = UIColor.White; window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Window = new UIWindow (UIScreen.MainScreen.Bounds); Window.RootViewController = new ViewController (); Window.MakeKeyAndVisible (); return true; }
// // 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; }
private void InitPanoramaSample() { this.window = new UIWindow(UIScreen.MainScreen.Bounds); this.window.RootViewController = new TestPanorama(); this.window.MakeKeyAndVisible(); }
private MXTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window) : base(theApp, appDelegate, window) { touchNavigation = new MXTouchNavigation(appDelegate, window); ViewGroups = new List<MXTouchViewGroup>(); }
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); } }
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; }
// // 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; }
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; }
// // 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 window = new UIWindow (UIScreen.MainScreen.Bounds); var web = new WebElement (); web.HtmlFile = "instructions"; var root = new RootElement ("Kannada Keyboard") { new Section{ new UIViewElement("Instruction", web.View, false) } }; var dv = new DialogViewController (root) { Autorotate = true }; var navigation = new UINavigationController (); navigation.PushViewController (dv, true); window = new UIWindow (UIScreen.MainScreen.Bounds); window.MakeKeyAndVisible (); window.AddSubview (navigation.View); return true; }
public static int SortByWindowID(UIWindow w1, UIWindow w2) { return(w1.WindowId.CompareTo(w2.WindowId)); }
public Setup(MvxApplicationDelegate applicationDelegate, UIWindow window) : base(applicationDelegate, window) { }
private Task <MediaFile> GetMediaAsync(UIImagePickerControllerSourceType sourceType, string mediaType, StoreCameraMediaOptions options = null) { UIWindow window = UIApplication.SharedApplication.KeyWindow; if (window == null) { throw new InvalidOperationException("There's no current active window"); } UIViewController viewController = window.RootViewController; if (viewController == null) { window = UIApplication.SharedApplication.Windows.OrderByDescending(w => w.WindowLevel).FirstOrDefault(w => w.RootViewController != null); if (window == null) { throw new InvalidOperationException("Could not find current view controller"); } else { viewController = window.RootViewController; } } while (viewController.PresentedViewController != null) { viewController = viewController.PresentedViewController; } MediaPickerDelegate ndelegate = new MediaPickerDelegate(viewController, sourceType, options); var od = Interlocked.CompareExchange(ref this.pickerDelegate, ndelegate, null); if (od != null) { throw new InvalidOperationException("Only one operation can be active at at time"); } var picker = SetupController(ndelegate, sourceType, mediaType, options); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad && sourceType == UIImagePickerControllerSourceType.PhotoLibrary) { ndelegate.Popover = new UIPopoverController(picker); ndelegate.Popover.Delegate = new MediaPickerPopoverDelegate(ndelegate, picker); ndelegate.DisplayPopover(); } else { viewController.PresentViewController(picker, true, null); } return(ndelegate.Task.ContinueWith(t => { if (this.popover != null) { this.popover.Dispose(); this.popover = null; } Interlocked.Exchange(ref this.pickerDelegate, null); return t; }).Unwrap()); }
public AuthorizationControllerDelegate(UIWindow presentationAnchor) { _presentationAnchor = presentationAnchor; }
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, [Transient] UIWindow forWindow) { return(DisplayInformation.AutoRotationPreferences.ToUIInterfaceOrientationMask()); }
public void IsKeyWindow_5199() { using (UIWindow w = new UIWindow()) { Assert.False(w.IsKeyWindow, "IsKeyWindow"); } }
// Show / Hide fade animation coroutine private IEnumerator FadeAnimation(FadeMethods method, float FadeDuration) { if (this.panel == null) { yield break; } // Check if we are trying to fade in and the window is already shown if (method == FadeMethods.In && this.panel.alpha == 1f) { yield break; } else if (method == FadeMethods.Out && this.panel.alpha == 0f) { yield break; } // Define that animation is in progress this.animationCurrentMethod = method; // Get the timestamp float startTime = Time.time; // Determine Fade in or Fade out if (method == FadeMethods.In) { // Calculate the time we need to fade in from the current alpha float internalDuration = (FadeDuration - (FadeDuration * this.panel.alpha)); // Update the start time startTime -= (FadeDuration - internalDuration); // Fade In while (Time.time < (startTime + internalDuration)) { float RemainingTime = (startTime + FadeDuration) - Time.time; float ElapsedTime = FadeDuration - RemainingTime; // Update the alpha by the percentage of the time elapsed this.panel.alpha = (ElapsedTime / FadeDuration); yield return(0); } // Make sure it's 1 this.panel.alpha = 1f; // Invoke them events current = this; EventDelegate.Execute(this.onShowComplete); current = null; } else if (method == FadeMethods.Out) { // Calculate the time we need to fade in from the current alpha float internalDuration = (FadeDuration * this.panel.alpha); // Update the start time startTime -= (FadeDuration - internalDuration); // Fade Out while (Time.time < (startTime + internalDuration)) { float RemainingTime = (startTime + FadeDuration) - Time.time; // Update the alpha by the percentage of the remaing time this.panel.alpha = (RemainingTime / FadeDuration); yield return(0); } // Make sure it's 0 this.panel.alpha = 0f; // Invoke them events current = this; EventDelegate.Execute(this.onHideComplete); current = null; this.contentHolder.gameObject.SetActive(false); } // No longer animating this.animationCurrentMethod = FadeMethods.None; }
{ public HybridPresenter(IUIApplicationDelegate applicationDelegate, UIWindow window, MvxFormsApp mvxFormsApp) : base(applicationDelegate, window) { this.MvxFormsApp = mvxFormsApp; }
public T GetWindow <T>(EUIWindowKey windowKey) where T : UIWindow { UIWindow window = GetWindow(windowKey); return(window != null ? window as T : null); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { if (!UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { Theme.Apply(); } // // Create the service // // Local CSV file service = MemoryDirectoryService.FromCsv("Data/XamarinDirectory.csv"); // LDAP service - uncomment to try it out. //service = new LdapDirectoryService { // Host = "ldap.mit.edu", // SearchBase = "dc=mit,dc=edu", //}; // // Load the favorites // var favoritesRepository = XmlFavoritesRepository.OpenIsolatedStorage("Favorites.xml"); if (favoritesRepository.GetAll().Count() == 0) { favoritesRepository = XmlFavoritesRepository.OpenFile("Data/XamarinFavorites.xml"); favoritesRepository.IsolatedStorageName = "Favorites.xml"; } // // Load the last search // Search search = null; try { search = Search.Open("Search.xml"); } catch (Exception) { search = new Search("Search.xml"); } // // Build the UI // favoritesViewController = new FavoritesViewController(favoritesRepository, service, search); window = new UIWindow(UIScreen.MainScreen.Bounds); window.RootViewController = new UINavigationController(favoritesViewController); window.MakeKeyAndVisible(); // // Show the login screen at startup // var login = new LoginViewController(service); favoritesViewController.PresentViewController(login, false, null); return(true); }
public MvxIosViewPresenter(IUIApplicationDelegate applicationDelegate, UIWindow window) { this._applicationDelegate = applicationDelegate; this._window = window; }
public MvxModalSupportTouchViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) : base(applicationDelegate, window) { }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { pickPhoto = new StringElement("Pick Photo"); pickPhoto.Tapped += () => { mediaPicker.PickPhotoAsync().ContinueWith(t => { // User canceled or something went wrong if (t.IsCanceled || t.IsFaulted) { return; } // We get back a MediaFile MediaFile media = t.Result; ShowPhoto(media); }, uiScheduler); // Make sure we use the UI thread to show our photo. }; takePhoto = new StringElement("Take Photo"); takePhoto.Tapped += () => { // Make sure we actually have a camera if (!mediaPicker.IsCameraAvailable) { ShowUnsupported(); return; } // When capturing new media, we can specify it's name and location mediaPicker.TakePhotoAsync(new StoreCameraMediaOptions { Name = "test.jpg", Directory = "MediaPickerSample" }) .ContinueWith(t => { if (t.IsCanceled || t.IsFaulted) { return; } ShowPhoto(t.Result); }, uiScheduler); }; takeVideo = new StringElement("Take Video"); takeVideo.Tapped += () => { // Make sure video is supported and a camera is available if (!mediaPicker.VideosSupported || !mediaPicker.IsCameraAvailable) { ShowUnsupported(); return; } // When capturing video, we can hint at the desired quality and length. // DesiredLength is only a hint, however, and the resulting video may // be longer than desired. mediaPicker.TakeVideoAsync(new StoreVideoOptions { Quality = VideoQuality.Medium, DesiredLength = TimeSpan.FromSeconds(10), Directory = "MediaPickerSample", Name = "test.mp4" }) .ContinueWith(t => { if (t.IsCanceled || t.IsFaulted) { return; } ShowVideo(t.Result); }, uiScheduler); }; pickVideo = new StringElement("Pick Video"); pickVideo.Tapped += () => { if (!mediaPicker.VideosSupported) { ShowUnsupported(); return; } mediaPicker.PickVideoAsync().ContinueWith(t => { if (t.IsCanceled || t.IsFaulted) { return; } ShowVideo(t.Result); }, uiScheduler); }; var root = new RootElement("Xamarin.Media Sample") { new Section("Picking media") { pickPhoto, pickVideo }, new Section("Capturing media") { takePhoto, takeVideo } }; dialogController = new DisposingMediaViewController(root); viewController = new UINavigationController(dialogController); window = new UIWindow(UIScreen.MainScreen.Bounds); window.RootViewController = viewController; window.MakeKeyAndVisible(); return(true); }
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 //PreferenceHandler preferenceHandler = new PreferenceHandler(); //UIStoryboard storyBoard = UIStoryboard.FromName("Main", null); //UIViewController vc; //if (preferenceHandler.IsLoggedIn()) //{ // vc = storyBoard.InstantiateViewController("ViewController") as ViewController; // //vc = storyBoard.InstantiateViewController("MapViewController") as MapViewController; //} //else //{ // vc = storyBoard.InstantiateViewController("ViewController") as ViewController; //} //this.Window.RootViewController = new UINavigationController(vc); //// set our root view controller with the sidebar menu as the apps root view controller Window = new UIWindow(UIScreen.MainScreen.Bounds); Window.RootViewController = new RootViewController(); this.Window.MakeKeyAndVisible(); UIApplication.SharedApplication.RegisterForRemoteNotifications(); //FCM integration start App.Configure(); // Register your app for remote notifications. if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0)) { // iOS 10 or later var authOptions = UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound; UNUserNotificationCenter.Current.RequestAuthorization(authOptions, (granted, error) => { Console.WriteLine(granted); }); // For iOS 10 display notification (sent via APNS) UNUserNotificationCenter.Current.Delegate = this; // For iOS 10 data message (sent via FCM) Messaging.SharedInstance.RemoteMessageDelegate = this; } else { // iOS 9 or before var allNotificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound; var settings = UIUserNotificationSettings.GetSettingsForTypes(allNotificationTypes, null); UIApplication.SharedApplication.RegisterUserNotificationSettings(settings); } UIApplication.SharedApplication.RegisterForRemoteNotifications(); Messaging.SharedInstance.Connect(error => { if (error != null) { // Handle if something went wrong while connecting Console.WriteLine("FCM Connect error: " + error); } else { // Let the user know that connection was successful Console.WriteLine("FCM Connection successful"); } }); //var token = InstanceId.SharedInstance.Token; // Monitor token generation InstanceId.Notifications.ObserveTokenRefresh((sender, e) => { // Note that this callback will be fired everytime a new token is generated, including the first // time. So if you need to retrieve the token as soon as it is available this is where that // should be done. var refreshedToken = InstanceId.SharedInstance.Token; // Do your magic to refresh the token where is needed if (Constants.IsDemoMode) { Messaging.SharedInstance.Subscribe("AlertsDemo"); } else { Messaging.SharedInstance.Subscribe("Alerts"); } }); // Request notification permissions from the user if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0)) { try { UNUserNotificationCenter.Current.RequestAuthorization(UNAuthorizationOptions.Alert, (approved, err) => { // Handle approval }); } catch (Exception) { } } //FCM integration end return(true); }
public void OpenWindow(UIWindow window) { window.Open(); m_ActiveWindow = window; }
/// <summary> /// Finished the launching. /// </summary> /// <param name="app">The app.</param> /// <param name="options">The options.</param> /// <returns>True or false.</returns> public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Window = new UIWindow(UIScreen.MainScreen.Bounds); Presenter = new IosViewPresenter(this.Window); var setup = new Setup(this, Presenter); setup.Initialize(); // Initialize the error service! var errorService = Mvx.Resolve <IErrorService>(); errorService.Init(); var culture = new System.Globalization.CultureInfo("en"); System.Threading.Thread.CurrentThread.CurrentUICulture = culture; System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = culture; // Setup theme UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, true); Theme.Setup(); var features = Mvx.Resolve <IFeaturesService>(); var defaultValueService = Mvx.Resolve <IDefaultValueService>(); var purchaseService = Mvx.Resolve <IInAppPurchaseService>(); purchaseService.ThrownExceptions.Subscribe(ex => { AlertDialogService.ShowAlert("Error Purchasing", ex.Message); errorService.Log(ex); }); #if DEBUG features.ActivateProDirect(); #endif // options = new NSDictionary (UIApplication.LaunchOptionsRemoteNotificationKey, // new NSDictionary ("r", "octokit/octokit.net", "i", "739", "u", "thedillonb")); // if (options != null) { if (options.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey)) { var remoteNotification = options[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary; if (remoteNotification != null) { HandleNotification(remoteNotification, true); } } } // Set the client constructor GitHubSharp.Client.ClientConstructor = () => new HttpClient(new HttpMessageHandler()); bool hasSeenWelcome; if (!defaultValueService.TryGet("HAS_SEEN_WELCOME_INTRO", out hasSeenWelcome) || !hasSeenWelcome) { defaultValueService.Set("HAS_SEEN_WELCOME_INTRO", true); var welcomeViewController = new CodeHub.iOS.ViewControllers.Walkthrough.WelcomePageViewController(); welcomeViewController.WantsToDimiss += GoToStartupView; TransitionToViewController(welcomeViewController); } else { GoToStartupView(); } Window.MakeKeyAndVisible(); // Notifications don't work on teh simulator so don't bother if (Runtime.Arch != Arch.SIMULATOR && features.IsProEnabled) { RegisterUserForNotifications(); } return(true); }
public CustomerManagementPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) : base(applicationDelegate, window) { }
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, UIWindow forWindow) { return(UIInterfaceOrientationMask.Landscape); }
// Creates a UIAlertAction which includes a call to hide the presenting UIWindow at the end UIAlertAction CreateActionWithWindowHide(string text, UIAlertActionStyle style, Action setResult, UIWindow window) { return(UIAlertAction.Create(text, style, a => { window.Hidden = true; setResult(); })); }
public virtual void PlatformInitialize(IMvxApplicationDelegate applicationDelegate, UIWindow window) { _window = window; _applicationDelegate = applicationDelegate; }
public void Insert(UIWindow uiWindow) { uiWindow.transform.SetParent(transform); }
private void Awake() { _window = GetComponent <UIWindow>(); }
public TogglPresenter(IUIApplicationDelegate applicationDelegate, UIWindow window) : base(applicationDelegate, window) { nestedPresentationInfo = createNestedPresentationInfo(); }
/// <summary> /// Initializes a new instance of the <see cref="Bootstrapper{TRootViewModel}" /> class. /// </summary> public Bootstrapper([NotNull] UIWindow window, [NotNull] IIocContainer iocContainer, IEnumerable <Assembly> assemblies = null, IViewModelSettings viewModelSettings = null, params IModule[] modules) : base(window)
//To Lock Screen Rotation public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, UIWindow forWindow) { switch (Device.Idiom) { case TargetIdiom.Phone: return(UIInterfaceOrientationMask.Landscape); case TargetIdiom.Tablet: return(UIInterfaceOrientationMask.Landscape); default: return(UIInterfaceOrientationMask.Landscape); } }
public Login(UIWindow window, IAccountsRepository repository) { this.repository = repository; _window = window; }
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, [Transient] UIWindow forWindow) { if (disableAllOrientation == true) { return(UIInterfaceOrientationMask.Portrait); } return(UIInterfaceOrientationMask.All); }
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, UIWindow forWindow) { if (Xamarin.Forms.Application.Current == null || Xamarin.Forms.Application.Current.MainPage == null) { return(UIInterfaceOrientationMask.Landscape); } var mainPage = Xamarin.Forms.Application.Current.MainPage; if (mainPage is YarningsWebPage) { return(UIInterfaceOrientationMask.Landscape); } return(UIInterfaceOrientationMask.Landscape); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); var book = new AddressBook(); _rootElement = new RootElement("Json Example") { new Section("Json Demo") { JsonElement.FromFile("sample.json"), new JsonElement("Load from url", "http://localhost/sample.json") }, new Section("MT.D+Linq+Xamarin.Mobile") { new RootElement("Contacts with Phones") { from c in book.Where(c => c.Phones.Count() > 0) select new Section(c.DisplayName) { from p in c.Phones select(Element) new StringElement(p.Number) } } }, new Section("Tasks Sample using Json") }; _vc = new DialogViewController(_rootElement); _nav = new UINavigationController(_vc); window.RootViewController = _nav; window.MakeKeyAndVisible(); #region task demo int n = 0; _addButton = new UIBarButtonItem(UIBarButtonSystemItem.Add); _vc.NavigationItem.RightBarButtonItem = _addButton; _addButton.Clicked += (sender, e) => { ++n; var task = new Task { Name = "task " + n, DueDate = DateTime.Now }; var taskElement = JsonElement.FromFile("task.json"); taskElement.Caption = task.Name; var description = taskElement ["task-description"] as EntryElement; if (description != null) { description.Caption = task.Name; description.Value = task.Description; } var duedate = taskElement ["task-duedate"] as DateElement; if (duedate != null) { duedate.DateValue = task.DueDate; } _rootElement [2].Add(taskElement); }; #endregion return(true); }
public MvxTvosViewPresenter(IUIApplicationDelegate applicationDelegate, UIWindow window) { _applicationDelegate = applicationDelegate; _window = window; }