Exemplo n.º 1
0
        private async void LogoutButton_Clicked(object sender, EventArgs e)
        {
            AzureADAuth auth = new AzureADAuth();

            auth.ClearCache();
            auth.AuthenticateUser();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the Craft Worker Arrival page
        /// </summary>
        /// <param name="userName">the username of the authenticated user</param>
        /// <remarks>
        /// Need to hook up the job list to real data
        /// </remarks>
        public CraftWorkerArrivalList(AzureADAuth azureauth)
        {
            Task.Factory.StartNew(async() =>
            {
                await Task.Delay(100);
                Device.BeginInvokeOnMainThread(async() =>
                {
                    // load the jobs in the system
                    var jobs = await DataService.Default.GetAllJobs();
                    this.JobList.ItemsSource = jobs;
                });
            });

            InitializeComponent();
            auth = azureauth;
            this.ExpandTray.GestureRecognizers.Add(new TapGestureRecognizer(this.ExpandTrayOnTap));
            //this.CollapseTray.Clicked += CollapseTray_Clicked;
            this.CollapseTray.GestureRecognizers.Add(new TapGestureRecognizer(this.CollapseTrayOnTap));

            this.ListLabel.IsVisible = false;

            this.AdministratorNameLabel.Text = auth.UserName;

            this.JobList.ItemSelected += this.JobList_ItemSelected;

            this.CraftWorkerList.ItemTapped += this.CraftWorkerList_ItemTapped;

            this.LogoutButton.Clicked += LogoutButton_Clicked;
        }