public override void ViewDidLoad()
        {
            PullToRefresh = false;

            base.ViewDidLoad();

            AutomaticallyAdjustsScrollViewInsets = false;

            TableSource = new SettingsTableViewSource();
            TableSource.ItemSelected += (NSIndexPath arg1, SettingsShared.SettingsModel arg2) =>
            {
                if (arg2 == null || String.IsNullOrEmpty(arg2.Title))
                {
                    return;
                }

                if (arg2.Title.Equals(SettingsShared.navigation_item_my_outlets, StringComparison.InvariantCultureIgnoreCase))
                {
                    //this is used to counter the auto reload. See NewCardTableViewController
                    Transporter.SharedInstance.RemoveObject(Transporter.NewOutletAddedTransporterKey);
                    Transporter.SharedInstance.RemoveObject(Transporter.NewOutletAddedValueTransporterKey);

                    ApplicationExtensions.PushViewController(new MyOutletsViewController(), true);
                    return;
                }

                if (arg2.Title.Equals(SettingsShared.navigation_item_edit_profile, StringComparison.InvariantCultureIgnoreCase))
                {
                    ApplicationExtensions.PushViewController(new EditProfileViewController(), true);
                    return;
                }


                if (arg2.Title.Equals(SettingsShared.navigation_item_design, StringComparison.InvariantCultureIgnoreCase))
                {
                    Shared.DesignChanged();
                    TableView.ReloadRows(new NSIndexPath[] { arg1 }, UITableViewRowAnimation.Automatic);
                    return;
                }

                if (arg2.Title.Equals(SettingsShared.navigation_item_logout, StringComparison.InvariantCultureIgnoreCase))
                {
                    RealmUserServices.Logout();

                    if (Profile.CurrentProfile != null)
                    {
                        new LoginManager().LogOut();
                    }

                    var iPersistant = ServiceLocator.Instance.Resolve <IPersistantStorage>();
                    iPersistant.RemoveAll();

                    ApplicationExtensions.LoadStoryboardRoot("Landing", false);
                    return;
                }
            };
            TableView.Source = TableSource;
            TableSource.SetItems(TableView, Shared.GetTableItems());
        }
Esempio n. 2
0
 void SetupUnauthorizedCatcher()
 {
     if (UnauthorizedBoradcastNotification != null)
     {
         return;
     }
     UnauthorizedBoradcastNotification = NSNotificationCenter.DefaultCenter.AddObserver(new NSString(NVCRestHelper.UnauthorizedExceptionThrown), (NSNotification obj) =>
     {
         ApplicationExtensions.LoadStoryboardRoot("Landing", false);
     });
 }
Esempio n. 3
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            // 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

            ServiceLocator.Instance.Add <IS3Service, S3Service>();
            ServiceLocator.Instance.Add <IImageDownloader, ImageDownloader>();
            ServiceLocator.Instance.Add <IPersistantStorage, PersistantStorage>();
            ServiceLocator.Instance.Add <IBroadcastNotificaion, BroadCastNotificaion>();

            Profile.EnableUpdatesOnAccessTokenChange(true);
            Settings.AppID       = NotSensitive.SlinkKeys.facebook_app_id;
            Settings.DisplayName = NotSensitive.SlinkKeys.facebook_display_name;

            if (RealmUserServices.DidUserPersist())
            {
                ApplicationExtensions.EnterApplication(false, true);
            }
            else
            {
                ApplicationExtensions.LoadStoryboardRoot("Landing", false);
            }

            SetupUnauthorizedCatcher();
            PredownloadImages();

            AppCenter.Start("fa06eb43-8be9-426c-97f9-42f3ab13cd3b", typeof(Analytics), typeof(Crashes));
            ServiceRunner.SharedInstance.StartService <AppCenterManager>();

            MobileAds.Configure("ca-app-pub-4252799872870196~2848379026");
            return(true);
        }