Пример #1
0
        public App()
        {
            InitializeComponent();
            MainEvents = new EventEntriesMain();
            MyEvents   = new MyEventEntries();



            InteractivePage            = new InteractiveSchedulePage(MainEvents, MyEvents, MyPage);
            MyPage                     = new MySchedulePage(MyEvents, InteractivePage);
            InteractivePage.mySchudule = MyPage;

            Task.Factory.StartNew(() => {
                return(MainEvents.refreshData(saveLoad.loadDatabaseFromFile()));
            })
            .ContinueWith(task =>
            {
                InteractivePage.refresh();
                refreshInteractivePage(task.Result);
            }, TaskScheduler.FromCurrentSynchronizationContext());

            Task.Factory.StartNew(() => { updateMyEvents(); }).ContinueWith(task =>
            {
                MyPage.refresh();
            }, TaskScheduler.FromCurrentSynchronizationContext());


            MyPage.Title          = "Personal";
            InteractivePage.Title = "Main";
            var nav = new NavigationPage();

            var tab = new TabbedPage
            {
                Padding  = 0,
                Children =
                {
                    InteractivePage,
                    MyPage,
                    new MapPage(),
                    new InfoPage()
                }
            };

            var passwordPage = new Password(tab);

            passwordPage.Start(tab);
            NavigationPage.SetHasNavigationBar(tab, false);
            NavigationPage.SetHasBackButton(tab, false);

            //Preload about image
            ImageService.Instance.LoadUrl(AppResources.aboutPicture).Preload();
            //Preload the default image
            ImageService.Instance.LoadUrl(AppResources.defaultPicture).Preload();
        }
Пример #2
0
        public InteractiveSchedulePage(EventEntriesMain _MainEvents, MyEventEntries _MyEvents, MySchedulePage _mySchedule = null)
        {
            InitializeComponent();
            mySchudule   = _mySchedule;
            this.Padding = GetPagePadding();
            MyEvents     = _MyEvents;
            MainEvents   = _MainEvents;


            LoadingText                         = new Label();
            LoadingText.FontSize                = 20;
            LoadingText.HorizontalOptions       = LayoutOptions.Center;
            LoadingText.VerticalOptions         = LayoutOptions.Center;
            LoadingText.HorizontalTextAlignment = TextAlignment.Center;
            LoadingText.FontAttributes          = FontAttributes.Italic;
            LoadingText.Text                    = "Loading Database...";
            this.Content                        = LoadingText;

            lvForEvents = new SchedListView(MainEvents.Events);
            lvForEvents.ItemSelected += PopUpWithData;
        }