diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-07-18 10:02:01 +0200 |
---|---|---|
committer | Stephane Delcroix <stephane@delcroix.org> | 2016-07-18 10:02:01 +0200 |
commit | dead1e0959d0c36f2c14a1329b60f01c73b809bb (patch) | |
tree | b624d76a7ecabb2e0bc4001ec226c7caebcc3e79 | |
parent | 962c8fd352e32309c9dcb7f8c2f07a335f18fc75 (diff) | |
download | xamarin-forms-dead1e0959d0c36f2c14a1329b60f01c73b809bb.tar.gz xamarin-forms-dead1e0959d0c36f2c14a1329b60f01c73b809bb.tar.bz2 xamarin-forms-dead1e0959d0c36f2c14a1329b60f01c73b809bb.zip |
Revert "[Xaml] allow the Previewer to provide their own Xaml files for any type"
This reverts commit 962c8fd352e32309c9dcb7f8c2f07a335f18fc75.
-rw-r--r-- | Xamarin.Forms.Xaml/IXamlFileProvider.cs | 9 | ||||
-rw-r--r-- | Xamarin.Forms.Xaml/Xamarin.Forms.Xaml.csproj | 1 | ||||
-rw-r--r-- | Xamarin.Forms.Xaml/XamlLoader.cs | 15 |
3 files changed, 2 insertions, 23 deletions
diff --git a/Xamarin.Forms.Xaml/IXamlFileProvider.cs b/Xamarin.Forms.Xaml/IXamlFileProvider.cs deleted file mode 100644 index 7f989019..00000000 --- a/Xamarin.Forms.Xaml/IXamlFileProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Xamarin.Forms.Xaml -{ - public interface IXamlFileProvider - { - string GetXamlFor(Type type); - } -}
\ No newline at end of file diff --git a/Xamarin.Forms.Xaml/Xamarin.Forms.Xaml.csproj b/Xamarin.Forms.Xaml/Xamarin.Forms.Xaml.csproj index 0081f67c..cb4577c9 100644 --- a/Xamarin.Forms.Xaml/Xamarin.Forms.Xaml.csproj +++ b/Xamarin.Forms.Xaml/Xamarin.Forms.Xaml.csproj @@ -81,7 +81,6 @@ <Compile Include="ExpandMarkupsVisitor.cs" /> <Compile Include="XamlCompilationAttribute.cs" /> <Compile Include="TypeArgumentsParser.cs" /> - <Compile Include="IXamlFileProvider.cs" /> </ItemGroup> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> <ItemGroup> diff --git a/Xamarin.Forms.Xaml/XamlLoader.cs b/Xamarin.Forms.Xaml/XamlLoader.cs index e0dd894f..37bea4e4 100644 --- a/Xamarin.Forms.Xaml/XamlLoader.cs +++ b/Xamarin.Forms.Xaml/XamlLoader.cs @@ -38,8 +38,6 @@ namespace Xamarin.Forms.Xaml internal static class XamlLoader { static readonly Dictionary<Type, string> XamlResources = new Dictionary<Type, string>(); - internal static bool DoNotThrowOnExceptions { get; set; } - internal static IXamlFileProvider XamlFileProvider { get; set; } public static void Load(object view, Type callingType) { @@ -66,16 +64,12 @@ namespace Xamarin.Forms.Xaml var rootnode = new RuntimeRootNode (new XmlType (reader.NamespaceURI, reader.Name, null), view, (IXmlNamespaceResolver)reader); XamlParser.ParseXaml (rootnode, reader); - Visit (rootnode, new HydratationContext { - RootElement = view, - DoNotThrowOnExceptions = XamlLoader.DoNotThrowOnExceptions - }); + Visit (rootnode, new HydratationContext { RootElement = view }); break; } } } - [Obsolete ("Use the XamlFileProvider to provide xaml files")] public static object Create (string xaml, bool doNotThrow = false) { object inflatedView = null; @@ -119,12 +113,6 @@ namespace Xamarin.Forms.Xaml static string GetXamlForType(Type type) { - string xaml = null; - - //the Previewer might want to provide it's own xaml for this... let them do that - if (XamlFileProvider != null && (xaml = XamlFileProvider.GetXamlFor(type)) != null) - return xaml; - var assembly = type.GetTypeInfo().Assembly; string resourceId; @@ -141,6 +129,7 @@ namespace Xamarin.Forms.Xaml // first pass, pray to find it because the user named it correctly + string xaml = null; foreach (var resource in resourceNames) { if (ResourceMatchesFilename(assembly, resource, likelyResourceName)) |