Skip to content

Instantly share code, notes, and snippets.

@mr5z
Created January 5, 2025 08:13
Show Gist options
  • Save mr5z/8065f8c963d80f0249077127314de30f to your computer and use it in GitHub Desktop.
Save mr5z/8065f8c963d80f0249077127314de30f to your computer and use it in GitHub Desktop.
Workaround since binding doesn't work yet on IDrawable/GraphicsView
internal class CustomGraphicsView : GraphicsView
{
// TODO workaround since binding doesn't work yet on IDrawable/GraphicsView
// https://github.com/dotnet/maui/issues/20991
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
if (BindingContext is not null)
{
if (Drawable is BindableObject bindable)
{
bindable.BindingContext = BindingContext;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment