async void Logout(object sender, EventArgs e) { Button button = (Button)sender; ButtonLock(); ProfilePage page = (ProfilePage)App.Mainpage.Children[2]; await button.ScaleTo(0.8f, 80, Easing.BounceOut); await button.ScaleTo(1, 80, Easing.BounceOut); page.Logout(); ButtonLock(); }
async void Settings(object sender, EventArgs e) { Button button = (Button)sender; ButtonLock(); ProfilePage page = (ProfilePage)App.Mainpage.Children[2]; await button.ScaleTo(0.8f, 80, Easing.BounceOut); await button.ScaleTo(1, 80, Easing.BounceOut); App.Startpage.IsPresented = false; page.Settings(sender, e); ButtonLock(); }
/* * * The MainPage contains four children, each showed as tabs in the main view. * * The initialization adds a search button to the toolbar, changes the main color, and creates the four pages of the main view as children. * */ public MainPage() { InitializeComponent(); UnselectedTabColor = Color.FromHex("FFFFFF"); SelectedTabColor = Color.FromHex("FFFFFF"); ToolbarItems.Add(new ToolbarItem("Search", "Icon_Search_white.png", async() => { var page = new ContentPage(); var result = await page.DisplayAlert("Title", "Message", "Accept", "Cancel"); Debug.WriteLine("success: {0}", result); })); Children[3] = new HubbPage(); Children[2] = new ProfilePage(); Children[1] = new NewsGridPage(0); Children[0] = new CustomNewsFeed(); }
async void Logout(object sender, EventArgs e) { Button button = (Button)sender; ButtonLock(); ProfilePage page = (ProfilePage)App.Mainpage.Children[2]; page.Logout(); await button.RotateTo(-5, 80, Easing.BounceOut); await button.RotateTo(5, 120, Easing.BounceOut); await button.RotateTo(0, 80, Easing.BounceOut); ButtonLock(); UserSettingsB.IsEnabled = false; LogoutB.IsEnabled = false; }