<ProjectReference Include="..\Xamarin.Forms.Material.iOS\Xamarin.Forms.Material.iOS.csproj">
<Project>{8A75B1DC-CEED-4B1B-8675-A7DFFD1E6DE4}</Project>
<Name>Xamarin.Forms.Material.iOS</Name>
+ <IsAppExtension>false</IsAppExtension>
+ <IsWatchApp>false</IsWatchApp>
</ProjectReference>
</ItemGroup>
<ItemGroup>
internal class RenderWith { }
internal class RenderWithChild : RenderWith { }
internal class RenderWithChildTarget : IRegisterable { }
+ internal class RenderWithSetAsNewDefault : IRegisterable { }
internal class VisualButtonTarget : IRegisterable { }
internal class VisualSliderTarget : IRegisterable { }
[Test]
+ public void RegisteringANewDefaultShouldReplaceRenderWithAttributeForFallbackVisual()
+ {
+ Internals.Registrar.Registered.Register(typeof(RenderWith), typeof(RenderWithSetAsNewDefault));
+ var renderWithTarget = Internals.Registrar.Registered.GetHandler(typeof(RenderWith), typeof(VisualMarkerUnitTests));
+
+ Assert.That(renderWithTarget, Is.InstanceOf<RenderWithSetAsNewDefault>());
+ }
+
+
+ [Test]
public void EnsureDefaultChildRendererTrumpsParentRenderWith()
{
Xamarin.Forms.Internals.Registrar.Registered.Register(typeof(RenderWithChild), typeof(RenderWithChildTarget));
for (int i = 0; i < supportedVisuals.Length; i++)
visualRenderers[supportedVisuals[i]] = trender;
}
-
+
public void Register(Type tview, Type trender) => Register(tview, trender, _defaultVisualRenderers);
internal TRegistrable GetHandler(Type type) => GetHandler(type, _defaultVisualType);
else if (visualType == _materialVisualType)
VisualMarker.MaterialCheck();
- if (visualType != _defaultVisualType && _handlers.TryGetValue(_defaultVisualType, out visualRenderers))
+ if (visualType != _defaultVisualType && visualRenderers != null)
if (visualRenderers.TryGetValue(_defaultVisualType, out Type specificTypeRenderer))
return specificTypeRenderer;
if (visualRenderers.TryGetValue(visualType, out handlerType))
return true;
- if (visualType != _defaultVisualType && _handlers.TryGetValue(viewType, out visualRenderers))
+ if (visualType != _defaultVisualType && visualRenderers != null)
if (visualRenderers.TryGetValue(_defaultVisualType, out handlerType))
return true;
<ProjectReference Include="..\Xamarin.Forms.Platform.iOS\Xamarin.Forms.Platform.iOS.csproj">
<Project>{271193C1-6E7C-429C-A36D-3F1BE5267231}</Project>
<Name>Xamarin.Forms.Platform.iOS</Name>
+ <IsAppExtension>false</IsAppExtension>
+ <IsWatchApp>false</IsWatchApp>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj">
<Project>{57B8B73D-C3B5-4C42-869E-7B2F17D354AC}</Project>