async void SetText() { UkName.Text = Settings.MobileSettings.main_name; if (!string.IsNullOrWhiteSpace(Settings.Person.companyPhone)) { LabelPhone.Text = "+" + Settings.Person.companyPhone.Replace("+", ""); } else { IconViewLogin.IsVisible = false; LabelPhone.IsVisible = false; } LabelTitle.Text = _announcementInfo.Header; LabelDate.Text = _announcementInfo.Created; LabelText.Text = _announcementInfo.Text; FrameBtnQuest.BackgroundColor = (Color)Application.Current.Resources["MainColor"]; int announcementInfoAdditionalServiceId = _announcementInfo.AdditionalServiceId; if (announcementInfoAdditionalServiceId != -1) { _additional = Settings.GetAdditionalService(announcementInfoAdditionalServiceId); byte[] imageByte = await _server.GetPhotoAdditional(announcementInfoAdditionalServiceId.ToString()); if (imageByte != null) { Stream stream = new MemoryStream(imageByte); ImageAdd.Source = ImageSource.FromStream(() => { return(stream); }); ImageAdd.IsVisible = true; var openAdditional = new TapGestureRecognizer(); openAdditional.Tapped += async(s, e) => { await Navigation.PushAsync(new AdditionalOnePage(_additional)); }; ImageAdd.GestureRecognizers.Add(openAdditional); } } if (_announcementInfo.QuestionGroupID != -1) { _polls = Settings.GetPollInfo(_announcementInfo.QuestionGroupID); FrameBtnQuest.IsVisible = true; } Color hexColor = (Color)Application.Current.Resources["MainColor"]; IconViewLogin.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.White); Pancake.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); PancakeViewIcon.SetAppThemeColor(PancakeView.BorderColorProperty, hexColor, Color.Transparent); if (Device.RuntimePlatform == Device.iOS) { if (AppInfo.PackageName == "rom.best.saburovo" || AppInfo.PackageName == "sys_rom.ru.tsg_saburovo") { PancakeViewIcon.Padding = new Thickness(0); } } //LabelTech.SetAppThemeColor(Label.TextColorProperty, hexColor, Color.Black); //IconViewTech.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.Black); }
protected override async void OnBindingContextChanged() { base.OnBindingContextChanged(); CachedImage.Source = RestClientMP.SERVER_ADDR + $"/AdditionalServices/logo/{Detail}"; CachedImage.HeightRequest = ImageHeight; return; if (BindingContext != null) { byte[] imageByte = null; try { imageByte = await BlobCache.UserAccount.GetObject <byte[]>(LogoFileId); } catch (KeyNotFoundException ex) { } if (imageByte == null) { imageByte = await _server.GetPhotoAdditional(Detail); await BlobCache.UserAccount.InsertObject(LogoFileId, imageByte); } else { Stream stream = new MemoryStream(imageByte); //image = new Image(); image.Source = ImageSource.FromStream(() => { return(stream); }); image.VerticalOptions = LayoutOptions.FillAndExpand; image.Aspect = Aspect.Fill; image.HorizontalOptions = LayoutOptions.FillAndExpand; image.HeightRequest = ImageHeight; //frame.Content = image; } } }