Skip to content

Instantly share code, notes, and snippets.

@FlavioGoncalves-Cayas
FlavioGoncalves-Cayas / CustomToolbarHandler.cs
Created June 3, 2024 09:06
Workaround for IconImageSource not working in .NET MAUI Android
using Android.Content;
using Android.Content.Res;
using Android.Graphics.Drawables;
using Android.Runtime;
using Android.Util;
using AndroidX.AppCompat.Graphics.Drawable;
using AndroidX.Core.Content.Resources;
using Google.Android.Material.AppBar;
using JetBrains.Annotations;
using Microsoft.Maui.Handlers;
@FlavioGoncalves-Cayas
FlavioGoncalves-Cayas / OnOrientationExtension.cs
Last active May 20, 2024 15:43
.NET MAUI OnOrientationExtension
[ContentProperty(nameof(Default))]
public class OnOrientationExtension : IMarkupExtension<BindingBase>
{
public Type TypeConverter { get; set; }
public object Default { get; set; }
public object Landscape { get; set; }
public object Portrait { get; set; }
static OnOrientationExtension()
{