Created
January 5, 2025 08:13
-
-
Save mr5z/8065f8c963d80f0249077127314de30f to your computer and use it in GitHub Desktop.
Workaround since binding doesn't work yet on IDrawable/GraphicsView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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