that ships with VS 2015. ▪ The philosophy behind this version is straightforward: improve simple everyday coding scenarios, without adding much conceptual baggage. ▪ The features should make code lighter without making the language heavier.
string First { get; } = "Jane"; public string Last { get; } = "Doe"; } public class Customer { public string Name { get; } public Customer(string first, string last) { Name = first + " " + last; } }
namespace class Program { static void Main() { var range = Range(5, 17); // Ok: not extension var odd = Where(range, i => i % 2 == 1); // Error, not in scope var even = range.Where(i => i % 2 == 0); // Ok } }
is null Customer first = customers?[0]; // null if customers is null int length = customers?.Length ?? 0; // 0 if customers is null int? first = customers?[0].Orders.Count(); // new int? first = (customers != null) ? customers[0].Orders.Count() : null; // old int? first = customers?[0].Orders?.Count(); // Chained PropertyChanged?.Invoke(this, args); // Invoke on ?
p.Name, p.Age); var s = $"{p.Name} is {p.Age} year{{s}} old"; var s = $"{p.Name,20} is {p.Age:D3} year{{s}} old"; var s = $"{p.Name} is {p.Age} year{(p.Age == 1 ? "" : "s")} old";
try { res = await Resource.OpenAsync(…); // You could do this. } catch(ResourceException e) { await Resource.LogAsync(res, e); // Now you can do this … } finally { if (res != null) await res.CloseAsync(); // … and this. }
platforms ▪ Most advanced Mvvm library for Xamarin and .NET cross platform ▪ Large and engaged community ▪ Fast release cycle ▪ Clean and easy conventions Miguel de Icaza (Xamarin CTO) “I love MvvmCross” ▪ Used by many enterprise companies e.g: - Microsoft - Xamarin inc. - Dutch government - Olo - Nokia Scott Hanselman (Microsoft Developer Evangelist) “I am really impressed with MvvmCross”
- LoginView > LoginViewModel ▪ Generics can be used too - LoginView : MvxActivity<LoginViewModel> - MainView : MvxActivity<SomeDifferentNameViewModel> ▪ Possible to override in setup.cs - protected override IDictionary<Type, Type> GetViewModelViewLookup()
Don’t try to invent the wheel again, use plugins, samples, etc ▪ Use Xamarin player or GenyMotion as emulator for Android ▪ Test all changes (UITest, Unit test, etc) ▪ Use a common PCL profile (profile7 or profile259) or .NET Platform Standard ▪ Enable “Analysis” XS > Preferences > Text Editor > Source Analysis > Enable ▪ Get help on Slack: https://xamarinchat.herokuapp.com/ ▪ Follow influencers on Twitter #Xamarin #MvvmCross ▪ Join the MvvmCross LinkedIn group