Closed gillesmessier closed 7 years ago
Disagree with this. Button can have anything for it's Content. After all, it is a ContentControl. A Button is not limited to just Text.
I am not asking to remove the Content property. Just expose a supplementary property.
I also don't like this. Having two properties that does the same thing is bad. If I set the content to a TextBlock, what value does the 'Text" property have? And what if I set it to an image? What happens if I set both?
Could be like that: If the "content" property has been set this overrides the "text" property. If the "content" property has not been defined, what will prevail is the "text" property.
Thinking better, forget what I said up ahead. I think this is going to complicate things, maybe it's better to just have the "content" property
You should close the issue if no longer valid
Humm...right I can circumvent the duplicate resources problem by systematically transforming all:
<Button x:Uid="str_Refresh" Content="Refresh" />
to
<Button> <TextBlock x:Uid="str_Refresh" Text="Refresh"/> </Button>
Hence there is no more need for the str_Refresh.Content definition. This workaround is working very well. With this there is no need to expose any Text property. Thank you all you were right.
For two reasons 1) Unify usage of all controls where the Text and Content properties behave the same when just assigning a simple string value. I think Xamarin.Forms does it right actually. 2) Simplify a bit the actual localization process forcing you to duplicate a resource string for different control types. Actually you have to define two strings: one for the Content property of a Button and another for the Text property of a TextBox. Example of a Resource.resw file (one for each supported language)
Note: the Content property of all button controls could be preserved and behave as it is; I am asking to expose a complementary Text property.