public MyProfilePage() { InitializeComponent(); bottomMenu.SetCurrentPage("MyProfilePage"); this.Title = AppResources.MyProfile; userInfo.Username = App.mUser.Username; userInfo.Name = App.mUser.Name; //userInfo.TelNo = App.mUser.Phone_Number; //userInfo.IDCard = App.mUser.Country_ID_Card; bankInfo.BankName = App.mUser.Bank_Name; bankInfo.BankCardNumber = App.mUser.Bank_Card_Number; if (App.mUser.Avatar == null || App.mUser.Avatar == "") { userInfo.ImageProfile = "https://lh3.googleusercontent.com/-0Olet6FXcxA/AAAAAAAAAAI/AAAAAAAAAAA/3_ZjPngHGYQ/s128-c-k/photo.jpg"; } else { userInfo.ImageProfile = Constants.host + "/" + App.mUser.Avatar; } userInfo.ImageCache(); btnChangeProfileImage.Clicked += async(sender, args) => { if (!CrossMedia.Current.IsPickPhotoSupported) { await DisplayAlert(AppResources.PhotosNotSupported, AppResources.PermissionNotGrantedToPhotos, AppResources.OK); return; } var file = await CrossMedia.Current.PickPhotoAsync(); if (file == null) { return; } IsBusy = true; User user = await App.UserManager.UploadProfileImage(file, App.mUser.ID); App.mUser = user; //reset user profile picture userInfo.ImageProfile = Constants.host + "/" + App.mUser.Avatar; userInfo.ImageCache(); //reset sidemenu profile picture DrawerPage dwpage = App.mDrawerPage; dwpage.SetProfileImage(App.mUser.Avatar); IsBusy = false; }; }
public MenuPage() { InitializeComponent(); var menuPage = new DrawerPage(); menuPage.OnMenuSelect = (categoryPage) => { Detail = new NavigationPage(categoryPage) { BarBackgroundColor = Color.FromHex("#ffffff"), BarTextColor = Color.Black }; IsPresented = false; }; Master = menuPage; Detail = new NavigationPage(new ChatRoomCategoryListPage()) { BarBackgroundColor = Color.FromHex("#ffffff"),//your color here BarTextColor = Color.Black }; }
public void listRefresh() { var mainPage = new MenuPage(); var drawerPage = new DrawerPage(); drawerPage.OnMenuSelect = (categoryPage) => { mainPage.Detail = new NavigationPage(categoryPage) { BarBackgroundColor = Color.FromHex("#ffffff"), BarTextColor = Color.Black }; mainPage.IsPresented = false; }; mainPage.Master = drawerPage; mainPage.Detail = new NavigationPage(new EnrollListPage(mCurrentPage)) { BarBackgroundColor = Color.FromHex("#ffffff"),//your color here BarTextColor = Color.Black }; App.Current.MainPage = mainPage; }