↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Xamarin.Forms - Write Once, Run Everywhere, AND Be Native? - Scott Hanselman

Scott Hanselman presents Xamarin.Forms as a way to share C# code across iOS, Android, and Windows Phone while still rendering native controls on each platform. He contrasts it with older Java-style cross-platform UIs that worked everywhere but did not integrate with the host platform.

The post shows a sample app where the navigation menu, blog list, and loading indicator are built from Xamarin.Forms controls and layouts, while the RSS and Twitter loading logic stays shared in async code and XML parsing. Hanselman’s main point is that the framework keeps the native look and feel without forcing separate UI and logic code for every platform.

Reading notes
#

  • Xamarin.Forms abstracts controls to a higher level but maps them to native controls at runtime.
  • The same shared C# codebase can build UIs for iOS, Android, and Windows Phone.
  • The sample Hanselman app aggregates the blog and tweets and runs natively on all three platforms.
  • UI code uses shared concepts like StackLayout, ListView, DataTemplate, ActivityIndicator, and binding.
  • The app’s feed loading and parsing logic is shared, using HttpClient, async and await, and Linq to XML.
  • The post argues that native look comes from wrapping native controls, not from inventing new ones.
  • Xamarin.Forms is presented as a way to hide repetitive cross-platform UI work while keeping the option to use platform specifics when needed.