I need to display the photo on the right side of the menu with ToolbarItem
.
I return the photo of the database for the "Photo" property of type string
.
Convert the photo string to Base64
and assignment to component Image
of Xamarin Forms
.
In other%% of%, this process works perfectly, but now I need to display it in the ToolbarItem.
How can I do this?
My code:
\\ View
<ContentPage.ToolbarItems>
<ToolbarItem Name="Menu2" Order="Primary" Priority="1">
<ToolbarItem.Icon>
</ToolbarItem.Icon>
</ToolbarItem>
</ContentPage.ToolbarItems>
\\ XAML
byte[] imageBytes;
var FileImage = new Image();
imageBytes = Convert.FromBase64String(Foto);
FileImage.Source = ImageSource.FromStream(() => new MemoryStream(imageBytes));
I need to display the photo here: