// Use this for initialization void Start() { navController = NavigationController.Instance; highScoreManager = new HighScoreManager (); highScores = highScoreManager.LoadAllScores (); PopulateHighScores (); }
static void Main() { Log.Info("Program.Main", "Starting..."); try { using (INavigationController navigationController = new NavigationController()) { navigationController.Push(typeof(HomeViewController)); navigationController.Run(); } } catch (Exception ex) { Dialog.Error("runtimeException".Translate(), ex.Message, ex); } Log.Info("Program.Main", "...Exiting"); }
void ExpenseDetail_Delete_Clicked(object sender, EventArgs e) { CoreUtilities.GetLogService().Log(nameof(ExpenseDetailController), "try to delete expense"); _expense.Delete(); NavigationController.PopViewController(true); }
public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); // show the nav bar when other controllers appear NavigationController.SetNavigationBarHidden(false, true); }
public override void ViewDidLoad() { base.ViewDidLoad(); ShowHelpIfNecessary(TutorialHelper.Profiles); btnBack.TouchUpInside += (sender, e) => NavigationController.PopViewController(true); feedController = Storyboard.InstantiateViewController <FeedViewController>(); feedController.HeaderView = vwHeader; feedController.Id = SportId; feedController.Type = FeedType.Sport; feedController.RefreshStarted += (sender, e) => GetData(); AddChildViewController(feedController); AddToScrollView(feedController.View, 0); feedController.HideAddPost(); scoresController = Storyboard.InstantiateViewController <ScoresViewController>(); scoresController.SportId = SportId; AddToScrollView(scoresController.View, 1); scoresController.HideFilter(); AddChildViewController(scoresController); rankingsController = Storyboard.InstantiateViewController <SportRankingsViewController>(); rankingsController.SportId = SportId; AddToScrollView(rankingsController.View, 2); AddChildViewController(rankingsController); aboutController = Storyboard.InstantiateViewController <SportAboutViewController>(); aboutController.SportId = SportId; AddToScrollView(aboutController.View, 3); AddChildViewController(aboutController); svScroller.ContentSize = new CoreGraphics.CGSize() { Width = UIScreen.MainScreen.Bounds.Width * 4 }; svScroller.Scrolled += (sender, e) => { lcIndicatorLeading.Constant = svScroller.ContentOffset.X / 4f; int position = (int)(svScroller.ContentOffset.X / UIScreen.MainScreen.Bounds.Width); if (svScroller.ContentOffset.X % UIScreen.MainScreen.Bounds.Width > (UIScreen.MainScreen.Bounds.Width / 2f)) { position++; } if (position == 1) { ShowHelpIfNecessary(TutorialHelper.SchedulesScores); } }; GetData(); btnProfile.TouchUpInside += (sender, e) => { svScroller.SetContentOffset(new CoreGraphics.CGPoint(), true); }; btnScores.TouchUpInside += (sender, e) => { svScroller.SetContentOffset(new CoreGraphics.CGPoint() { X = UIScreen.MainScreen.Bounds.Width }, true); }; btnRankings.TouchUpInside += (sender, e) => { svScroller.SetContentOffset(new CoreGraphics.CGPoint() { X = UIScreen.MainScreen.Bounds.Width * 2 }, true); }; btnAbout.TouchUpInside += (sender, e) => { svScroller.SetContentOffset(new CoreGraphics.CGPoint() { X = UIScreen.MainScreen.Bounds.Width * 3 }, true); }; btnFollow.TouchUpInside += (sender, e) => { if (profile == null) { return; } Shared.Follower.ToggleFollow(btnFollow, profile, profile.Id, FeedType.Sport, (following) => { GetData(); }); }; if (GoToRankings) { svScroller.SetContentOffset(new CGPoint() { X = UIScreen.MainScreen.Bounds.Width * 2 }, false); } lblFollowers.Superview.AddGestureRecognizer(new UITapGestureRecognizer(() => { if (profile == null) { return; } var controller = Storyboard.InstantiateViewController <FollowersViewController>(); controller.Id = profile.Id; controller.Type = FeedType.Sport; NavigationController.PushViewController(controller, true); })); }
private void GoToPublicGists() { var vc = Gists.GistsViewController.CreatePublicGistsViewController(); NavigationController?.PushViewController(vc, true); }
private void GoToTrendingRepositories() { var vc = new Repositories.TrendingRepositoriesViewController(); NavigationController?.PushViewController(vc, true); }
private void CreateMenuRoot() { var username = ViewModel.Account.Username; Title = username; ICollection <Section> sections = new LinkedList <Section>(); sections.Add(new Section { new MenuElement("Profile", () => ViewModel.GoToProfileCommand.Execute(null), Octicon.Person.ToImage()), (_notifications = new MenuElement("Notifications", () => ViewModel.GoToNotificationsCommand.Execute(null), Octicon.Inbox.ToImage()) { NotificationNumber = ViewModel.Notifications }), new MenuElement("News", () => ViewModel.GoToNewsCommand.Execute(null), Octicon.RadioTower.ToImage()), new MenuElement("Issues", () => ViewModel.GoToMyIssuesCommand.Execute(null), Octicon.IssueOpened.ToImage()) }); Uri avatarUri; Uri.TryCreate(ViewModel.Account.AvatarUrl, UriKind.Absolute, out avatarUri); var eventsSection = new Section { HeaderView = new MenuSectionView("Events") }; eventsSection.Add(new MenuElement(username, () => ViewModel.GoToMyEvents.Execute(null), Octicon.Rss.ToImage(), avatarUri)); if (ViewModel.Organizations != null && ViewModel.Account.ShowOrganizationsInEvents) { foreach (var org in ViewModel.Organizations) { Uri.TryCreate(org.AvatarUrl, UriKind.Absolute, out avatarUri); eventsSection.Add(new MenuElement(org.Login, () => ViewModel.GoToOrganizationEventsCommand.Execute(org.Login), Octicon.Rss.ToImage(), avatarUri)); } } sections.Add(eventsSection); var repoSection = new Section() { HeaderView = new MenuSectionView("Repositories") }; repoSection.Add(new MenuElement("Owned", GoToOwnedRepositories, Octicon.Repo.ToImage())); repoSection.Add(new MenuElement("Starred", GoToStarredRepositories, Octicon.Star.ToImage())); repoSection.Add(new MenuElement("Trending", GoToTrendingRepositories, Octicon.Pulse.ToImage())); repoSection.Add(new MenuElement("Explore", () => NavigationController.PushViewController(new ExploreViewController(), true), Octicon.Globe.ToImage())); sections.Add(repoSection); if (ViewModel.PinnedRepositories.Any()) { _favoriteRepoSection = new Section() { HeaderView = new MenuSectionView("Favorite Repositories") }; foreach (var pinnedRepository in ViewModel.PinnedRepositories) { _favoriteRepoSection.Add(new PinnedRepoElement(pinnedRepository, ViewModel.GoToRepositoryCommand)); } sections.Add(_favoriteRepoSection); } else { _favoriteRepoSection = null; } var orgSection = new Section() { HeaderView = new MenuSectionView("Organizations") }; if (ViewModel.Organizations != null && ViewModel.Account.ExpandOrganizations) { foreach (var org in ViewModel.Organizations) { Uri.TryCreate(org.AvatarUrl, UriKind.Absolute, out avatarUri); orgSection.Add(new MenuElement(org.Login, () => ViewModel.GoToOrganizationCommand.Execute(org.Login), Images.Avatar, avatarUri)); } } else { orgSection.Add(new MenuElement("Organizations", () => ViewModel.GoToOrganizationsCommand.Execute(null), Octicon.Organization.ToImage())); } //There should be atleast 1 thing... if (orgSection.Elements.Count > 0) { sections.Add(orgSection); } var gistsSection = new Section() { HeaderView = new MenuSectionView("Gists") }; gistsSection.Add(new MenuElement("My Gists", GoToOwnedGists, Octicon.Gist.ToImage())); gistsSection.Add(new MenuElement("Starred", GoToStarredGists, Octicon.Star.ToImage())); gistsSection.Add(new MenuElement("Public", GoToPublicGists, Octicon.Globe.ToImage())); sections.Add(gistsSection); // var infoSection = new Section() { HeaderView = new MenuSectionView("Info & Preferences") }; sections.Add(infoSection); infoSection.Add(new MenuElement("Settings", () => ViewModel.GoToSettingsCommand.Execute(null), Octicon.Gear.ToImage())); if (ViewModel.ShouldShowUpgrades) { infoSection.Add(new MenuElement("Upgrades", GoToUpgrades, Octicon.Lock.ToImage())); } infoSection.Add(new MenuElement("Feedback & Support", GoToSupport, Octicon.CommentDiscussion.ToImage())); infoSection.Add(new MenuElement("Accounts", ProfileButtonClicked, Octicon.Person.ToImage())); Root.Reset(sections); }
void OpenFolder(IMailFolder folder) { messageListViewController = new MessageListViewController(folder); NavigationController.PushViewController(messageListViewController, true); }
public MainWindow() { NavigationController Singleton = NavigationController.GetInstance(); this.NavigationService.Navigate(Singleton.page1); }
public override void ViewDidLoad() { base.ViewDidLoad(); locationmanager = new CLLocationManager(); if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { locationmanager.RequestAlwaysAuthorization(); } beaconUUID = new NSUuid(uuid); beaconRegion = new CLBeaconRegion(beaconUUID, beaconMajor, beaconMinor, beaconId); beaconRegion.NotifyEntryStateOnDisplay = true; beaconRegion.NotifyOnEntry = true; beaconRegion.NotifyOnExit = true; locationmanager.RegionEntered += (sender, e) => { var notification = new UILocalNotification() { AlertBody = "The Xamarin beacon is close by!" }; UIApplication.SharedApplication.CancelAllLocalNotifications(); UIApplication.SharedApplication.PresentLocalNotificationNow(notification); }; //create beacon region beaconUUID = new NSUuid(uuid); beaconRegion = new CLBeaconRegion(beaconUUID, beaconMajor, beaconMinor, beaconId); locationmanager.DidRangeBeacons += (object sender, CLRegionBeaconsRangedEventArgs e) => { if (e.Beacons == null || e.Beacons.Length == 0) { return; } LabelBeacon.Text = "We found: " + e.Beacons.Length + " beacons"; var beacon = e.Beacons[0]; switch (beacon.Proximity) { case CLProximity.Far: View.BackgroundColor = UIColor.Blue; break; case CLProximity.Near: View.BackgroundColor = UIColor.Yellow; break; case CLProximity.Immediate: View.BackgroundColor = UIColor.Green; break; } LabelDistance.Text = "We are: " + beacon.Accuracy.ToString("##.000"); if (beacon.Accuracy <= .1 && beacon.Proximity == CLProximity.Immediate) { locationmanager.StopRangingBeacons(beaconRegion); var vc = UIStoryboard.FromName("MainStoryboard", null).InstantiateViewController("FoundViewController"); NavigationController.PushViewController(vc, true); } }; locationmanager.StartRangingBeacons(beaconRegion); }
using Foundation; using System; using System.Collections.Generic; using Newtonsoft.Json.Linq; using UIKit; using CoreGraphics; namespace SaitamaGourmet { public partial class RestaurantListViewController : UIViewController { public AreaMasterMiddles targetAreaItem { get; set; } public List<Restaurants> restData { get; set; } DataSource dataSource; public string selectedCategory; public RestaurantListViewController(IntPtr handle) : base(handle) { } public void SetDetailItem(AreaMasterMiddles newTargetAreaItem) { if (targetAreaItem != null) { targetAreaItem = newTargetAreaItem; ConfigureView(); } } void ConfigureView() { // Update the user interface for the detail item Title = NSBundle.MainBundle.LocalizedString("レストラン一覧", "レストラン一覧"); restData = new List<Restaurants>(); dataSource = new DataSource(this); if (IsViewLoaded && targetAreaItem != null) { // レストラン情報取得 RestaurantSearchParam param = new RestaurantSearchParam(); param.areacode_m = targetAreaItem.areacode_m; param.category_l = selectedCategory; GourmetNaviAPI gourmetApi = new GourmetNaviAPI(); JObject data = gourmetApi.GetRestrantData(GourmetNaviAPI.ResturantSearch, param); //if (data == null && data.Count <= 2) //{ // UIAlertView alert = new UIAlertView(); // alert.Title = "Error"; // alert.AddButton("OK"); // alert.AddButton("Cancel"); // alert.Message = "This should be an error message"; // alert.Show(); //} int i = 0; int count = 0; int perPage = 0; if (!IsCheckNull(data["total_hit_count"])) { count = (int)data["total_hit_count"] - 4; } if (!IsCheckNull(data["hit_per_page"])) { perPage = (int)data["hit_per_page"]; } int index = 0; if (count > 0) { while (i < count) { if (i < count) { Restaurants rest = new Restaurants(); try { if (!IsCheckNull(data["rest"][index]["name"])) { rest.name = (string)data["rest"][index]["name"]; } if (!IsCheckNull(data["rest"][index]["name_sub"])) { rest.name_sub = (string)data["rest"][index]["name_sub"]; } if (!IsCheckNull(data["rest"][index]["name_kana"])) { rest.name_kana = (string)data["rest"][index]["name_kana"]; } if (!IsCheckNull(data["rest"][index]["business_hour"])) { rest.business_hour = (string)data["rest"][index]["business_hour"]; } if (!IsCheckNull(data["rest"][index]["opentime"])) { rest.opentime = data["rest"][index]["opentime"].ToString(); } if (!IsCheckNull(data["rest"][index]["holiday"])) { rest.holiday = (string)data["rest"][index]["holiday"]; } if (!IsCheckNull(data["rest"][index]["address"])) { rest.address = (string)data["rest"][index]["address"]; } if (!IsCheckNull(data["rest"][index]["tel"])) { rest.tel = (string)data["rest"][index]["tel"]; } if (!IsCheckNull(data["rest"][index]["fax"])) { rest.fax = (string)data["rest"][index]["fax"]; } if (!IsCheckNull(data["rest"][index]["pr"]["pr_short"])) { rest.pr_short = (string)data["rest"][index]["pr"]["pr_short"]; } if (!IsCheckNull(data["rest"][index]["pr"]["pr_long"])) { rest.pr_long = (string)data["rest"][index]["pr"]["pr_long"]; } if (!IsCheckNull(data["rest"][index]["access"]["line"])) { rest.line = (string)data["rest"][index]["access"]["line"]; } if (!IsCheckNull(data["rest"][index]["access"]["station"])) { rest.station = (string)data["rest"][index]["access"]["station"]; } if (!IsCheckNull(data["rest"][index]["access"]["station_exit"])) { rest.station_exit = (string)data["rest"][index]["access"]["station_exit"]; } if (!IsCheckNull(data["rest"][index]["access"]["walk"])) { rest.walk = (string)data["rest"][index]["access"]["walk"]; } if (!IsCheckNull(data["rest"][index]["access"]["note"])) { rest.note = (string)data["rest"][index]["access"]["note"]; } if (!IsCheckNull(data["rest"][index]["budget"])) { rest.budget = (string)data["rest"][index]["budget"]; } if (!IsCheckNull(data["rest"][index]["image_url"]["shop_image1"])) { rest.shop_image1 = (string)data["rest"][index]["image_url"]["shop_image1"]; } if (!IsCheckNull(data["rest"][index]["image_url"]["shop_image2"])) { rest.shop_image2 = (string)data["rest"][index]["image_url"]["shop_image2"]; } if (!IsCheckNull(data["rest"][index]["image_url"]["qrcode"])) { rest.qrcode = (string)data["rest"][index]["image_url"]["qrcode"]; } if (!IsCheckNull(data["rest"][index]["url_mobile"])) { rest.url_mobile = (string)data["rest"][index]["url_mobile"]; } if (!IsCheckNull(data["rest"][index]["url"])) { rest.url = (string)data["rest"][index]["url"]; } if (!IsCheckNull(data["rest"][index]["credit_card"])) { rest.credit_card = (string)data["rest"][index]["credit_card"]; } if (!IsCheckNull(data["rest"][index]["latitude"])) { rest.latitude = (double)data["rest"][index]["latitude"]; } if (!IsCheckNull(data["rest"][index]["longitude"])) { rest.longitude = (double)data["rest"][index]["longitude"]; } //rest.latitude_wgs84 = (double)data["rest"][index]["latitude_wgs84"]; //rest.longitude_wgs84 = (double)data["rest"][index]["ongitude_wgs84"]; } catch (Exception e) { Console.WriteLine(e.ToString()); break; } index++; restData.Add(rest); dataSource.Objects.Add(rest); } i++; if ((i % perPage) == 0) { param.offset_page++; index = 0; try { data = gourmetApi.GetRestrantData(GourmetNaviAPI.ResturantSearch, param); } catch (Exception e) { Console.WriteLine(e.ToString()); break; }; } } RestaurantListTableView.Source = dataSource; ((RestaurantTabViewController)(this.ParentViewController)).SetRestData(restData); } else { var alert = UIAlertController.Create("メッセージ", "指定され店舗の情報が存在しません。", UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, action => { NavigationController.PopViewController(true); })); this.PresentViewController(alert, true, null); } } } private bool IsCheckNull(object o) { if (o == null || o.ToString() == "{}") { return true; } else { return false; } } public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. targetAreaItem = ((RestaurantTabViewController)(this.ParentViewController)).targetAreaItem; selectedCategory = ((RestaurantTabViewController)(this.ParentViewController)).selectedCategory; ConfigureView(); } public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); } public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); ((RestaurantTabViewController)(this.ParentViewController)).SetRestData(restData); } public override void DidReceiveMemoryWarning() { base.DidReceiveMemoryWarning(); } public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender) { if (segue.Identifier == "restDetailFromList") { var indexPath = RestaurantListTableView.IndexPathForSelectedRow; var item = dataSource.Objects[indexPath.Row]; ((RestDetailTabViewController)segue.DestinationViewController).SetDetailItem(item); } } static UIImage FromUrl(string uri) { using (var url = new NSUrl(uri)) using (var data = NSData.FromUrl(url)) return UIImage.LoadFromData(data); } class DataSource : UITableViewSource { NSString CellIdentifier = new NSString("Cell"); readonly List<Restaurants> objects = new List<Restaurants>(); readonly RestaurantListViewController controller; public DataSource(RestaurantListViewController controller) { this.controller = controller; } public IList<Restaurants> Objects { get { return objects; } } // Customize the number of sections in the table view. public override nint NumberOfSections(UITableView tableView) { return 1; } public override nint RowsInSection(UITableView tableview, nint section) { return objects.Count; } private int rowNumber { get; set; } public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath) { return 80; } public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { controller.PerformSegue("restDetailFromList", this); } public override bool CanEditRow(UITableView tableView, NSIndexPath indexPath) { // Return false if you do not want the specified item to be editable. return true; } //Customize the appearance of table view cells. public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(CellIdentifier) as CustomVegeCell; if (cell == null) { cell = new CustomVegeCell(CellIdentifier); } if (String.IsNullOrWhiteSpace(objects[indexPath.Row].shop_image1)) { cell.UpdateCell(objects[indexPath.Row].name , UIImage.FromFile("noImage2.png") , objects[indexPath.Row].address, objects[indexPath.Row].station, objects[indexPath.Row].budget); } else { cell.UpdateCell(objects[indexPath.Row].name , FromUrl(objects[indexPath.Row].shop_image1) , objects[indexPath.Row].address, objects[indexPath.Row].station, objects[indexPath.Row].budget); } cell.BackgroundColor = UIColor.Clear; return cell; } } } // Custom Cell public class CustomVegeCell : UITableViewCell { UILabel headingLabel; UILabel subheadingLabel; UILabel subheadingLabel1; UILabel subheadingLabel2; UIImageView imageView; public CustomVegeCell(NSString Cell) : base(UITableViewCellStyle.Default, Cell) { imageView = new UIImageView(); headingLabel = new UILabel() { Font = UIFont.FromName("Cochin-BoldItalic", 17f), TextColor = UIColor.FromRGB(127, 51, 0), //BackgroundColor = UIColor.Clear } ; subheadingLabel = new UILabel() { Font = UIFont.FromName("AmericanTypewriter", 12f), TextColor = UIColor.FromRGB(80, 80, 80), //TextAlignment = UITextAlignment.Center, BackgroundColor = UIColor.Clear } ; subheadingLabel1 = new UILabel() { Font = UIFont.FromName("AmericanTypewriter", 11f), TextColor = UIColor.FromRGB(10, 10, 10), } ; subheadingLabel2 = new UILabel() { Font = UIFont.FromName("AmericanTypewriter", 12f), TextColor = UIColor.Red, } ; headingLabel.Lines = 0; headingLabel.LineBreakMode = UILineBreakMode.CharacterWrap; headingLabel.SizeToFit(); subheadingLabel.Lines = 0; subheadingLabel.LineBreakMode = UILineBreakMode.CharacterWrap; subheadingLabel.SizeToFit(); subheadingLabel1.Lines = 0; subheadingLabel1.LineBreakMode = UILineBreakMode.CharacterWrap; subheadingLabel1.SizeToFit(); ContentView.AddSubviews(new UIView[] { imageView, headingLabel, subheadingLabel, subheadingLabel1, subheadingLabel2 }); } public void UpdateCell(string caption, UIImage image, string subtitle, string subtitle1, string subtitle2) { headingLabel.Text = caption; imageView.Image = image; subheadingLabel.Text = subtitle; subheadingLabel1.Text = "最寄駅:" + subtitle1; subheadingLabel2.Text = "予算:" + subtitle2 + "円~"; } public override void LayoutSubviews() { base.LayoutSubviews(); imageView.Frame = new CGRect(3, 2, 70, ContentView.Bounds.Height - 3); headingLabel.Frame = new CGRect(ContentView.Bounds.Width - 300, -2, 300, 40); subheadingLabel.Frame = new CGRect(ContentView.Bounds.Width - 300, 30, 300, 35); subheadingLabel1.Frame = new CGRect(ContentView.Bounds.Width - 135, 45, 300, 50); subheadingLabel2.Frame = new CGRect(ContentView.Bounds.Width - 300, 45, 300, 50); } } }
async partial void BtnSend_TouchUpInside(UIButton sender) { if (string.Empty.Equals(txtEmail.Text)) { Utils.ShowToast("Please fill in the E-mail", 3000); } else { try { BTProgressHUD.Show("Checking...", -1, ProgressHUD.MaskType.Clear); UserModel user = await new LoginManager().GetUserByEmail(txtEmail.Text); if (user == null) { Utils.ShowToast("E-Mail not found", 3000); Utils.KillAfter(3); } else if (!string.IsNullOrEmpty(user.provider)) { Utils.ShowToast("Your acconut is binded with " + user.provider + ".\nPlease log in using " + user.provider, 3000); Utils.KillAfter(3); var loginController = this.Storyboard.InstantiateViewController("LoginController"); if (loginController != null) { this.NavigationController.PushViewController(loginController, true); } } else { BTProgressHUD.Show("Sending the E-mail...", -1, ProgressHUD.MaskType.Clear); NSUserDefaults.StandardUserDefaults.RemoveObject("AskkerPwdCode"); NSUserDefaults.StandardUserDefaults.RemoveObject("AskkerPwdTimeStamp"); int code = rdm.Next(10000); NSUserDefaults.StandardUserDefaults.SetString(code.ToString("0000"), "AskkerPwdCode"); NSUserDefaults.StandardUserDefaults.SetString(DateTime.Now.ToString("yyyyMMddHHmmss"), "AskkerPwdTimeStamp"); ResetPasswordModel model = new ResetPasswordModel(txtEmail.Text, code.ToString("0000")); await new LoginManager().SendEmailResetPasswordFromApp(model); BTProgressHUD.ShowSuccessWithStatus("E-mail Sent"); var confirmCodeController = this.Storyboard.InstantiateViewController("ConfirmCodeController") as ConfirmCodeController; if (confirmCodeController != null) { confirmCodeController.Email = txtEmail.Text; this.NavigationController.PushViewController(confirmCodeController, true); NavigationController.SetNavigationBarHidden(false, true); } txtEmail.Text = ""; } } catch (Exception ex) { BTProgressHUD.Dismiss(); NSUserDefaults.StandardUserDefaults.RemoveObject("AskkerPwdCode"); NSUserDefaults.StandardUserDefaults.RemoveObject("AskkerPwdTimeStamp"); if (ex.Message.Equals("906")) { Utils.ShowAlertOk("Forgot Password", "E-mail not registered"); } else { Utils.ShowAlertOk("Something went wrong", ex.Message); } } } }
public void Show(TestSuite suite) { NavigationController.PushViewController(suites_dvc [suite], true); }
protected void LaunchCalendarListScreen(EKEntityType calendarStore) { calendarListScreen = new Calendars.Screens.CalendarList.CalendarListController(calendarStore); NavigationController.PushViewController(calendarListScreen, true); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); NavigationController?.SetNavigationBarHidden(true, animated); }
partial void BtnCancel_TouchUpInside(UIButton sender) { NavigationController.DismissViewController(true, null); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. UIStoryboard storyboard = this.Storyboard; NavigationController.SetNavigationBarHidden(true, true); UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.None); var bg = new UIImageView(new CoreGraphics.CGRect(110, 0, View.Bounds.Width - 110, View.Bounds.Height)); bg.ContentMode = UIViewContentMode.ScaleAspectFit; bg.Image = UIImage.FromFile("images/map_demo.png"); View.Add(bg); var bar = new UIView { Frame = new CoreGraphics.CGRect(0, 0, 110, View.Bounds.Height), BackgroundColor = UIColor.FromRGB(32, 153, 255) }; View.Add(bar); var logo = new UIImageView(new CoreGraphics.CGRect(0, 0, 110, 110)); logo.ContentMode = UIViewContentMode.ScaleAspectFit; logo.Image = UIImage.FromFile("images/charlotte-crown.png"); logo.BackgroundColor = UIColor.FromRGB(23, 123, 204); View.AddSubview(logo); //Browse Maps Button var browseEventsButton = new UIButton { Frame = new CoreGraphics.CGRect(10, 120, 90, 90) }; browseEventsButton.SetImage(UIImage.FromFile("images/list.png"), UIControlState.Normal); View.Add(browseEventsButton); browseEventsButton.TouchUpInside += (object sender, EventArgs e) => { EventsViewController evcontroller = storyboard.InstantiateViewController("EventsViewController") as EventsViewController; this.NavigationController.PushViewController(evcontroller, false); }; //View Map Button var viewMapButton = new UIButton { Frame = new CoreGraphics.CGRect(10, 225, 90, 90), BackgroundColor = UIColor.FromRGB(23, 123, 204) }; viewMapButton.SetImage(UIImage.FromFile("images/map_icon.png"), UIControlState.Normal); View.Add(viewMapButton); viewMapButton.TouchUpInside += (object sender, EventArgs e) => { MapViewController mvcontroller = storyboard.InstantiateViewController("MapViewController") as MapViewController; this.NavigationController.PushViewController(mvcontroller, false); }; //View Map Button var myCalendarButton = new UIButton { Frame = new CoreGraphics.CGRect(10, 330, 90, 90) }; myCalendarButton.SetImage(UIImage.FromFile("images/calendar.png"), UIControlState.Normal); View.Add(myCalendarButton); myCalendarButton.TouchUpInside += (object sender, EventArgs e) => { CalendarViewController cvcontroller = storyboard.InstantiateViewController("CalendarViewController") as CalendarViewController; this.NavigationController.PushViewController(cvcontroller, false); }; //View Map Button var cityInfoButton = new UIButton { Frame = new CoreGraphics.CGRect(10, 435, 90, 90) }; cityInfoButton.SetImage(UIImage.FromFile("images/info.png"), UIControlState.Normal); View.Add(cityInfoButton); cityInfoButton.TouchUpInside += (object sender, EventArgs e) => { InfoViewController ivcontroller = storyboard.InstantiateViewController("InfoViewController") as InfoViewController; this.NavigationController.PushViewController(ivcontroller, false); }; //Settings Button var settingsButton = new UIButton { Frame = new CoreGraphics.CGRect(10, 540, 90, 90) }; settingsButton.SetImage(UIImage.FromFile("images/settings_icon.png"), UIControlState.Normal); View.Add(settingsButton); settingsButton.TouchUpInside += (object sender, EventArgs e) => { SettingsViewController svcontroller = storyboard.InstantiateViewController("SettingsViewController") as SettingsViewController; this.NavigationController.PushViewController(svcontroller, false); }; //Search Bar var searchBar = new UISearchBar { Frame = new CoreGraphics.CGRect(140, 40, View.Bounds.Width - 170, 30), BackgroundColor = UIColor.Clear }; View.Add(searchBar); }
public override void ViewDidLoad() { base.ViewDidLoad(); RootElement root = Root; Section examplesSection = new Section(); StyledStringElement helloWorldElement = new StyledStringElement("Hello world"); helloWorldElement.Tapped += () => { NavigationController.PushViewController( new HelloWorldUIViewController(), true ); }; examplesSection.Add(helloWorldElement); StyledStringElement planarSubdivisionElement = new StyledStringElement("Planar Subdivision"); planarSubdivisionElement.Tapped += () => { NavigationController.PushViewController( new PlanarSubdivisionDialogViewController(), true ); }; examplesSection.Add(planarSubdivisionElement); StyledStringElement faceDetectionElement = new StyledStringElement("Face Detection"); faceDetectionElement.Tapped += () => { NavigationController.PushViewController( new FaceDetectionDialogViewController(), true ); }; examplesSection.Add(faceDetectionElement); StyledStringElement surfFeatureElement = new StyledStringElement("SURF Feature"); surfFeatureElement.Tapped += () => { NavigationController.PushViewController( new SURFFeatureDialogViewController(), true ); }; examplesSection.Add(surfFeatureElement); StyledStringElement pedestrianDetectionElement = new StyledStringElement("Pedestrian Detection"); pedestrianDetectionElement.Tapped += () => { NavigationController.PushViewController( new PedestrianDetectionDialogViewController(), true ); }; examplesSection.Add(pedestrianDetectionElement); StyledStringElement trafficSignDetectionElement = new StyledStringElement("Stop Sign Detection"); trafficSignDetectionElement.Tapped += () => { NavigationController.PushViewController( new TrafficSignRecognitionDialogViewController(), true ); }; examplesSection.Add(trafficSignDetectionElement); StyledStringElement licensePlateDetectionElement = new StyledStringElement("License Plate Detection"); licensePlateDetectionElement.Tapped += () => { NavigationController.PushViewController( new LicensePlateRecognitionDialogViewController(), true ); }; examplesSection.Add(licensePlateDetectionElement); StyledStringElement cameraElement = new StyledStringElement("Camera"); cameraElement.Tapped += () => { NavigationController.PushViewController( new CameraDialogViewController(), true); }; examplesSection.Add(cameraElement); root.Add(examplesSection); }
private void ShowConfiguration(object sender, EventArgs e) { NavigationController.PushViewController(_selectionView, true); }
private void GoToStarredRepositories() { var vc = Repositories.RepositoriesViewController.CreateStarredViewController(); NavigationController?.PushViewController(vc, true); }
// The IntPtr and initWithCoder constructors are required for items that need // to be able to be created from a xib rather than from managed code public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = UIColor.Black; this.NavigationController.NavigationBar.BarTintColor = UIColor.Black; this.NavigationController.NavigationBar.TintColor = UIColor.Gray; this.NavigationController.NavigationBar.Translucent = false; this.NavigationController.NavigationBar.Opaque = true; this.NavigationItem.RightBarButtonItem = null; button = new UIButton(new RectangleF(20, 260, 280, 48)); button.SetTitle("Chart Styles", UIControlState.Normal); button.BackgroundColor = UIColor.DarkGray; button.SetTitleColor(UIColor.White, UIControlState.Normal); this.View.AddSubview(button); button.TouchDown += delegate(object sender, EventArgs e) { NavigationController.NavigationBar.Hidden = false; TypesTableController scontroller = new TypesTableController(false); NavigationController.PushViewController(scontroller, true); }; buttonStatistical = new UIButton(new RectangleF(20, 310, 280, 48)); buttonStatistical.SetTitle("Create new Chart", UIControlState.Normal); buttonStatistical.SetTitleColor(UIColor.White, UIControlState.Normal); buttonStatistical.BackgroundColor = UIColor.DarkGray; this.View.AddSubview(buttonStatistical); buttonStatistical.TouchDown += delegate(object sender, EventArgs e) { NavigationController.NavigationBar.Hidden = false; TypesTableController newccontroller = new TypesTableController(true); NavigationController.PushViewController(newccontroller, true); }; buttonAbout = new UIButton(new RectangleF(20, 360, 280, 48)); buttonAbout.SetTitle("About", UIControlState.Normal); buttonAbout.SetTitleColor(UIColor.White, UIControlState.Normal); buttonAbout.BackgroundColor = UIColor.Clear; this.View.AddSubview(buttonAbout); buttonAbout.TouchDown += delegate(object sender, EventArgs e) { AboutViewController controller = new AboutViewController(); NavigationController.PushViewController(controller, true); }; var image2Rect = new RectangleF(0f, 30f, 234f, 225f); using (var myImage = new UIImageView(image2Rect)) { myImage.Image = UIImage.FromFile("images/Chart1.png"); myImage.Opaque = false; this.View.AddSubview(myImage); } var imageRect = new RectangleF(190f, 20f, 111f, 80f); using (var myImage = new UIImageView(imageRect)) { myImage.Image = UIImage.FromFile("images/TeeChartBuilder.png"); myImage.Opaque = false; this.View.AddSubview(myImage); } }
private void GoToStarredGists() { var vc = Gists.GistsViewController.CreateStarredGistsViewController(); NavigationController?.PushViewController(vc, true); }
public virtual bool Navigate(IViewMappingItem source, string parameter, IDataContext dataContext) { Should.NotBeNull(source, nameof(source)); if (dataContext == null) { dataContext = DataContext.Empty; } bool bringToFront; dataContext.TryGetData(NavigationProviderConstants.BringToFront, out bringToFront); if (!RaiseNavigating(new NavigatingCancelEventArgs(source, bringToFront ? NavigationMode.Refresh : NavigationMode.New, parameter))) { return(false); } UIViewController viewController = null; IViewModel viewModel = dataContext.GetData(NavigationConstants.ViewModel); if (bringToFront && viewModel != null) { var viewControllers = new List <UIViewController>(NavigationController.ViewControllers); for (int i = 0; i < viewControllers.Count; i++) { var controller = viewControllers[i]; if (controller.DataContext() == viewModel) { viewControllers.RemoveAt(i); viewController = controller; NavigationController.ViewControllers = viewControllers.ToArray(); dataContext.AddOrUpdate(NavigationProviderConstants.InvalidateCache, true); break; } } } if (viewController == null) { if (viewModel == null) { viewController = (UIViewController)ServiceProvider.Get <IViewManager>().GetViewAsync(source, dataContext).Result; } else { viewController = (UIViewController)ViewManager.GetOrCreateView(viewModel, null, dataContext); } } viewController.SetNavigationParameter(parameter); bool shouldNavigate = true; if (_window != null) { bool navigated; InitializeNavigationController(GetNavigationController(_window, viewController, out navigated)); shouldNavigate = !navigated; _window = null; } if (shouldNavigate) { bool animated; if (dataContext.TryGetData(NavigationConstants.UseAnimations, out animated)) { viewModel?.Settings.State.AddOrUpdate(NavigationConstants.UseAnimations, animated); } else { animated = UseAnimations; } if (!ClearNavigationStackIfNeed(viewController, dataContext, animated)) { NavigationController.PushViewController(viewController, animated); } } var view = viewController as IViewControllerView; if (view == null || view.Mediator.IsAppeared) { RaiseNavigated(viewController, bringToFront ? NavigationMode.Refresh : NavigationMode.New, parameter); } else { if (bringToFront) { view.Mediator.ViewDidAppearHandler += OnViewDidAppearHandlerRefresh; } else { view.Mediator.ViewDidAppearHandler += OnViewDidAppearHandlerNew; } } return(true); }
private void GoToUpgrades() { var vc = new UpgradeViewController(); NavigationController?.PushViewController(vc, true); }
protected override void DoViewDidLoad() { base.DoViewDidLoad(); NavigationController.SetInnerNavigationControllerStyle(); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); // hide the nav bar when this controller appears NavigationController.SetNavigationBarHidden(true, true); }
private void GoBack(object sender, EventArgs e) { NavigationController.PopViewController(true); }
public SettingViewController() : base(UITableViewStyle.Plain, null) { Title = Strings.Settings; accountsSection = new MenuSection(Strings.Accounts) { (addNewAccountElement = new SettingsElement(Strings.AddStreamingService, async() => { try{ var vc = new ServicePickerViewController(); this.PresentModalViewController(new UINavigationController(vc), true); var service = await vc.GetServiceTypeAsync(); await ApiManager.Shared.CreateAndLogin(service); UpdateAccounts(); } catch (TaskCanceledException) { } catch (Exception ex) { Console.WriteLine(ex); } })), (lastFmElement = string.IsNullOrEmpty(ApiConstants.LastFmApiKey) ? null : new SettingsSwitch("Last.FM", Settings.LastFmEnabled)), (twitterScrobbleElement = new SettingsSwitch(Strings.AutoTweet, Settings.TwitterEnabled) { Detail = Settings.TwitterDisplay }), new SettingsSwitch(Strings.ImportIPodMusic, Settings.IncludeIpod) { ValueUpdated = ToggleIPod }, new MenuHelpTextElement(Strings.ImportIpodHint), }; Root = new RootElement(Strings.Settings) { accountsSection, new MenuSection(Strings.Playback) { new SettingsSwitch(Strings.EnableLikeOnTheLockScreen, Settings.ThubsUpOnLockScreen) { ValueUpdated = (b => { Settings.ThubsUpOnLockScreen = b; RemoteControlHandler.SetupThumbsUp(); }) }, new MenuHelpTextElement(Strings.EnableLikeHint), new SettingsSwitch(Strings.EnableGaplessPlayback, Settings.EnableGaplessPlayback) { ValueUpdated = (b => { Settings.EnableGaplessPlayback = b; }) }, new MenuHelpTextElement(Strings.EnableGapplessHint), new SettingsSwitch(Strings.PlayVideosWhenAvailable, Settings.PreferVideos) { ValueUpdated = (b => { Settings.PreferVideos = b; }) }, new MenuHelpTextElement(Strings.PlaysMusicVideoHint), new SettingsSwitch(Strings.PlayCleanVersionsOfSongs, Settings.FilterExplicit) { ValueUpdated = (b => { Settings.FilterExplicit = b; }) }, new MenuHelpTextElement(Strings.PlayesCleanVersionOfSongsHint), }, new MenuSection(Strings.Streaming) { new SettingsSwitch(Strings.DisableAllAccess, Settings.DisableAllAccess) { ValueUpdated = (on) => { Settings.DisableAllAccess = on; } }, new MenuHelpTextElement(Strings.DisableAllAccessHint), (CreateQualityPicker(Strings.CellularAudioQuality, Settings.MobileStreamQuality, (q) => Settings.MobileStreamQuality = q)), (CreateQualityPicker(Strings.WifiAudioQuality, Settings.WifiStreamQuality, (q) => Settings.WifiStreamQuality = q)), (CreateQualityPicker(Strings.VideoQuality, Settings.VideoStreamQuality, (q) => Settings.VideoStreamQuality = q)), (CreateQualityPicker(Strings.OfflineAudioQuality, Settings.DownloadStreamQuality, (q) => Settings.DownloadStreamQuality = q)), new MenuHelpTextElement(Strings.QualityHints) }, new MenuSection(Strings.Feedback) { new SettingsElement(Strings.SendFeedback, SendFeedback) { TextColor = iOS.Style.DefaultStyle.MainTextColor }, new SettingsElement($"{Strings.PleaseRate} {AppDelegate.AppName}", RateAppStore) { TextColor = iOS.Style.DefaultStyle.MainTextColor }, (ratingMessage = new MenuHelpTextElement(Strings.NobodyHasRatedYet)) }, new MenuSection(Strings.Settings) { CreateLanguagePicker(Strings.Language), CreateThemePicker(Strings.Theme), new SettingsElement(Strings.ResyncDatabase, () => { Database.Main.ResetDatabase(); Settings.ResetApiModes(); ApiManager.Shared.ReSync(); }), new MenuHelpTextElement(Strings.ResyncDatabaseHint), new SettingsSwitch(Strings.DisableAutoLock, Settings.DisableAutoLock) { ValueUpdated = (b => { Settings.PreferVideos = b; AutolockPowerWatcher.Shared.CheckStatus(); }) }, new MenuHelpTextElement(Strings.DisableAutoLockHelpText), new SettingsElement(Strings.DownloadQueue, () => NavigationController.PushViewController(new DownloadViewController(), true)), (songsElement = new SettingsElement(Strings.SongsCount)), new SettingsElement(Strings.Version) { Value = Device.AppVersion(), }, new StringElement(""), new StringElement(""), new StringElement(""), new StringElement(""), } }; if (lastFmElement != null) { lastFmElement.ValueUpdated = async b => { if (!b) { Settings.LastFmEnabled = false; ScrobbleManager.Shared.LogOut(); return; } var success = false; try { success = await ScrobbleManager.Shared.LoginToLastFm(); } catch (TaskCanceledException ex) { lastFmElement.Value = Settings.LastFmEnabled = false; TableView.ReloadData(); return; } Settings.LastFmEnabled = success; if (success) { return; } lastFmElement.Value = false; ReloadData(); App.ShowAlert(string.Format(Strings.ErrorLoggingInto, "Last.FM"), Strings.PleaseTryAgain); }; } twitterScrobbleElement.ValueUpdated = async b => { if (!b) { Settings.TwitterEnabled = false; Settings.TwitterDisplay = ""; Settings.TwitterAccount = ""; twitterScrobbleElement.Detail = ""; ScrobbleManager.Shared.LogOutOfTwitter(); return; } var success = await ScrobbleManager.Shared.LoginToTwitter(); if (!success) { Settings.TwitterEnabled = false; twitterScrobbleElement.Value = false; ReloadData(); return; } Settings.TwitterEnabled = true; twitterScrobbleElement.Detail = Settings.TwitterDisplay; ReloadData(); }; }
partial void FileChooseButton_TouchUpInside(UIButton sender) { NavigationController.PresentModalViewController(imagePicker, true); }
void ExpenseDetail_Cancel_Clicked(object sender, EventArgs e) { CoreUtilities.GetLogService().Log(nameof(ExpenseDetailController), "caceling expense page"); NavigationController.PopViewController(true); }
void GoBack() { NavigationController.PopViewController(true); }
public static void Start(string[] args) { // redirect console output to parent process; // must be before any calls to Console.WriteLine() AttachConsole(ATTACH_PARENT_PROCESS); Instance.appParams = new ApplicationParameters(); try { instance.appParams.ProcessParameters(args); } catch (ApplicationParametersException e) { MessageBox.Show("Parameters contain an error.\nError: " + e.Message, "Sokoban"); Environment.Exit(2); } // Command-line regime if (args.Length > 0 && args[0] == "/cmd") { // Todo: ApplicationRepository.Instance.OnStartUp(); } else { // launch the WPF application like normal NavigationController controller = new NavigationController(); NavigationService.AttachNavigator(controller); ApplicationRepository.Instance.MainWindow = new MainWindow(); ApplicationRepository.Instance.MainWindow.ShowDialog(); } }
// Use this for initialization void Start() { navController = NavigationController.Instance; }