protected override void OnAppearing() { base.OnAppearing(); checkAddclub = false; if (model == null) { model = this.BindingContext as MorePageViewModel; } MessagingCenter.Subscribe <App>((App)Xamarin.Forms.Application.Current, "Login", (sender) => { Device.BeginInvokeOnMainThread(() => { AccountName.Text = Helper.Instance().MyAccount.fullname; if (Helper.Instance().MyAccount.Avatar_Uri != "") { Avatar.Source = Helper.Instance().MyAccount.Avatar_Uri; } }); }); if (!firstOpenSite) { if (Helper.Instance().MyAccount != null) { AccountName.Text = Helper.Instance().MyAccount.fullname; if (string.IsNullOrEmpty(Helper.Instance().MyAccount.Avatar_Uri)) { Avatar.Source = "account.png"; } else { Avatar.Source = Helper.Instance().MyAccount.Avatar_Uri; } AccountName.Text = Helper.Instance().MyAccount.fullname; } imgEdit.Source = "edit_picture.png"; imgSearch.Source = "Search_location.png"; txtSearch.Text = "Tìm kiếm khu vực"; imgClub.Source = "add_club.png"; txtAddclub.Text = "Thêm câu lạc bộ"; imgMyclub.Source = "club.png"; txtMyClub.Text = "Câu lạc bộ"; txtLoguot.Text = "Đăng xuất"; } //xóa ảnh đã crop lên server if (!Helper.uriCover.Equals("")) { var list = new List <string>(); list.Add(Helper.uriCover); if (!Helper.uriCacheCover.Equals("")) { list.Add(Helper.uriCacheCover); Helper.uriCacheCover = ""; } DependencyService.Get <IMediaService>().ClearFiles(list); } }
public MorePage() { InitializeComponent(); BindingContext = new MorePageViewModel(); }