0
I need to display the photo on the right side of the menu with the ToolbarItem
.
I return the photo from the database to the property "Photo" type string
.
Convert the photo string to Base64
and attribute to the component Image
of Xamarin Forms
.
In another View
, this process works perfectly, but now I need to display it in Toolbaritem.
How can I do this ?
My code:
\\ XAML
<ContentPage.ToolbarItems>
<ToolbarItem Name="Menu2" Order="Primary" Priority="1">
<ToolbarItem.Icon>
</ToolbarItem.Icon>
</ToolbarItem>
</ContentPage.ToolbarItems>
\\ .CS
byte[] imageBytes;
var FileImage = new Image();
imageBytes = Convert.FromBase64String(Foto);
FileImage.Source = ImageSource.FromStream(() => new MemoryStream(imageBytes));
I need to show the photo here:
What’s the problem with your current code?
– Genos
@Genos So, even the part of Fileimage has no problem. I don’t know how to assign this Fileimage pro icone from Toolbaritem
– AndreeH