This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Conversation
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
Member
e7c324c
to
c7439ae
Compare
c7439ae
to
34eb6fd
Compare
StephaneDelcroix
added a commit
that referenced
this pull request
Dec 17, 2018
be ready for when we'll merge #4743
Merged
3 tasks
mattleibow
reviewed
Dec 18, 2018
public static class ResourceLoader | ||
{ | ||
static Func<AssemblyName, string, string> resourceProvider; | ||
|
||
[Obsolete("You shouldn't have used this one to begin with, don't use the other one either")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 😄
mattleibow
previously requested changes
Dec 18, 2018
An alternate xaml resource file provider can request the XamlLoader to _not_ ignore normally ignored properties in prebuilt XF design xmlns, as in the following snippet: ```xaml <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"" xmlns:d="http://xamarin.com/schemas/2014/forms/design"" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"" mc:Ignorable="d""> <Label d:Text="Bar" Text="Foo" x:Name="label" /> </ContentPage> ``` The `d:` should be the prefix used by default for this, but any other prefix will do too. The `d:Text` property maps to the exact same property as `Text`, as the XmllnsDefinitionAttributes are identical (that's convenient from a Intelisense point of view), but, when (and only when) instructed by a provided Xaml resource loader, the `d:Text` will override the `Text` property. This works with virtually all properties defined on built-in Xamarin.Forms controls, but it doesn't mean it's a sane idea to try to assign design value to all existing properties. The APi ofr setting the ResourceLoader had to change, and instead of taking pre-defined arguments, it accepts and returns query and response types. This is slightly less convenient to invoke through reflection, but way more easy to extend in the future.
34eb6fd
to
c4e25ea
Compare
StephaneDelcroix
added a commit
that referenced
this pull request
Dec 20, 2018
be ready for when we'll merge #4743
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An alternate xaml resource file provider can request the XamlLoader to
not ignore normally ignored properties in prebuilt XF design xmlns, as
in the following snippet:
The
d:
should be the prefix used by default for this, but any otherprefix will do too.
The
d:Text
property maps to the exact same property asText
, as theXmllnsDefinitionAttributes are identical (that's convenient from a Intelisense
point of view), but, when (and only when) instructed by a provided Xaml resource
loader, the
d:Text
will override theText
property.This works with virtually all properties defined on built-in Xamarin.Forms
controls, but it doesn't mean it's a sane idea to try to assign design value
to all existing properties.
The API for setting the ResourceLoader had to change, and instead of taking
pre-defined arguments, it accepts and returns query and response types. This
is slightly less convenient to invoke through reflection, but way more easy
to extend in the future.
As a side note, I'm quite proud, and thankful, of the work done by that 5-people
2-hours brainstorming-meeting that came up with the new name for the now
deprecated
ResourceProvider
.