MobileBlazorBindings
MobileBlazorBindings copied to clipboard
Change Debug.Fail() to Debug.WriteLine() in the NativeComponentAdapter()
In the NativeComponent adapter there are two Debug.Fail() calls. When debugging on iOS or Android these are basically the same as Debug.WriteLine and the app keeps running with a log in the console. When running on UWP this causes the app to pause, but if you hit play it seems to keep working fine.
Am I allowed to change these to Debug.WriteLine()s to make UWP usable and have it behave more consistently across platforms?
I've also created an issue(#295) to track the error that is causing this to happen.
The new block would look like:
if (!Renderer.ElementManager.IsParentOfChild(_closestPhysicalParent, matchedEarlierSibling._targetElement))
{
Debug.WriteLine($"Expected that the item found ({matchedEarlierSibling.DebugName}) with target element ({matchedEarlierSibling._targetElement.GetType().FullName}) should necessarily be an immediate child of the closest native parent ({_closestPhysicalParent.GetType().FullName}), but it wasn't...");
}