namespace Tapiit.App.Views.Courses
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class CoursesPage : ContentPage
{
public CoursesPage()
{
InitializeComponent();
var settings = new ApplicationSettings();
menuName.Text = settings.Name;
hamburgerButton.ImageSource = (FileImageSource)ImageSource.FromFile("ic_hamburger.png");
var list = new List();
list.Add(HamburgerItems.MyAccount);
list.Add(HamburgerItems.Logout);
listView.ItemsSource = list;
}
void hamburgerButton_Clicked(object sender, EventArgs e)
{
navigationDrawer.ToggleDrawer();
}
private async void listView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
if (e.SelectedItem.ToString() == HamburgerItems.MyAccount)
{
await Navigation.PushAsync(new MyAccountDetailsPage());
}
else if (e.SelectedItem.ToString() == HamburgerItems.Logout)
{
new ApplicationSettings()
{
AccessToken = string.Empty,
Email = string.Empty,
Password = string.Empty
};
Application.Current.MainPage = new NavigationPage(new LandingPage());
}
navigationDrawer.ToggleDrawer();
}
}
}