Disclosure: I work on Xamarin team at Microsoft
[1]https://forums.xamarin.com/discussion/85747/xamarin-forms-fe...
Disclosure: I work on Xamarin team at Microsoft
[1]https://forums.xamarin.com/discussion/85747/xamarin-forms-fe...
If I want to target cross platform apps (including Linux and Mac), should I wait for Xamarin Forms 3 or will UWP eventually expand to cover Mac & Linux?
I'm only a hobby programmer so I don't want to waste hours learning something that will be a dead end.
Any insight you might have would be very useful! thanks
If you check BUILD 2017 sessions, there were a couple of talks about it.
Any news on allowing JSON or another syntax as an alternative to XML-based XAML?
The XML-like syntax of XAML isn't the problem, it separates object properties from child content well due to it's nature - the bigger issue is how difficult binding syntax is to grok by anyone who hasn't been working with it for quite some time.
This is only the case for trivial properties - there is also the expanded form of properties and that's where it muddies XAML very quickly.
For example, in a WPF project of mine I have a DataGrid with a Templated column parenting an ItemsControl with HyperLink children (it displays a list of Phone numbers for each Customer row).
This is my current XAML - I understand this is the minimum I need to achieve that effect: https://pastebin.com/cRjT2PG5
It could be simplified drastically in two ways, for example:
* Eliminate `<ItemsPanelTemplate>` and `<DataTemplate>` elements, they're implicit in 90% of cases and yet add another element and indent level without conveying significant information. They could be expressed as attributes of the `<ItemsControl.ItemsPanel>` and `<ItemsContorl.ItemTemplate>` property elements.
* Allow C# expressions and the composition of child-binding to be used in property bindings, not just `String.Format` strings. In my example I have to populate `<Hyperlink.Tooltip>` with a full `<TextBlock>` and `<MultiBinding>` element - why can't I just do `<HyperLink ToolTip="{Binding Kind} {Binding Number}">`? That alone would 10 lines of my 42 line example.
Another issue with XAML is that the creators of XAML failed to learn from HTML+CSS: while it succeeds at separating programming code from view-level concerns, it fails at separating presentation from content - it's like we're back in HTML3/4 days when <table> and <font> were all around and it was nearly impossible to tweak and standardise a UI. XAML does have <Style> and <Setter> elements but they're more used for setting Template properties - the end result is a horrid mess.
XAML ultimately compiles to an object tree, if you're putting more than a reference, string, int, etc. into a property you need to construct it as a child element - if you want you are free to define the DataTemplate elsewhere in your XAML or in a resource dictionary and use the binding syntax.
> * Allow C# expressions and the composition of child-binding to be used in property bindings, not just `String.Format` strings. In my example I have to populate `<Hyperlink.Tooltip>` with a full `<TextBlock>` and `<MultiBinding>` element - why can't I just do `<HyperLink ToolTip="{Binding Kind} {Binding Number}">`? That alone would 10 lines of my 42 line example.
Use a converter? I know they're cumbersome to write, but that's what they exist for.
> Another issue with XAML is that the creators of XAML failed to learn from HTML+CSS: while it succeeds at separating programming code from view-level concerns, it fails at separating presentation from content - it's like we're back in HTML3/4 days when <table> and <font> were all around and it was nearly impossible to tweak and standardise a UI. XAML does have <Style> and <Setter> elements but they're more used for setting Template properties - the end result is a horrid mess.
Again, resource dictionaries, bind reusable styles to your elements. Syntax again sucks, `<TextBlock Style="{StaticResource AwesomeTextBlock}"/>`, and there IS the nagging issue that the styles are decided by the UI - but it's not too much worse than CSS classes.
Don't take any of this to mean your concerns aren't valid, but it's really not AS bad as you make it out to be. There's always room for improvement though!
Many of us do enjoy XML based tooling.
<Foo Trivial="trivial"> <Foo.Complex> <Bar Bound="{Binding qux}" /> </Foo.Complex> </Foo>
Could be represented in strict JSON as:
{ "Type": "Foo", "Trivial": "trivial", "Complex": { "Type": "Bar", "Bound": { "Type": "Binding", "Path": "qux" } } }
A more succint JSON-derivative would allow for the "Type" property to be specified anonymously, object keys as identifiers, not strings, allow comments, and use object constructors directly instead of object literals:
{ Foo, Trivial: "trivial", Complex: { Bar, Bound: new Binding( "qux" ) }
}
It is the other way around, JSON is a subset of XML features.
XML is a very expressive language/file format.
It even does iOS and Android without any recajiggering. You can just compile your desktop app straight to your cell phone if you want.
It's amazing.
Not really, it is a pain to use versus Xamarin.
All you get is QML and the freedom to implement all your bindings to Android and iOS APIs.
I have looked for xamarin.forms to be ready for years now, but still is very limited/inmutare. I'm building the most simplistic crud app with zero-care for good looks and good UI, yet every step requiere a workaround (for example, you can't have a Password EntryCell, you need to create it from code using a ViewCell).
Exist a lot of functionality available in the base controls not exposed in forms.
Now, with regret I'm thinking in use react native (that destroy the ability to use F#) or use HTML.
How much better will 3 be? Some place where I can talk about this?
I also can't imagine jumping ship to React Native. If you're going to jump off Xamarin Forms and already like f# / .net then native Xamarin.IOS and Xamarin.Android are more easy, powerful and expressive than React Native.