Sometimes you need to change a value for a specific platform and this value is a Double, for example. I spent a couple of minutes to find a working code. <Label> <Label.TranslationY> <OnPlatform x:TypeArguments=”x:Double” Android=”-10″ /> </Label.TranslationY> </Label> Happy coding!
Month: October 2017
The Invoke Smart Speaker Brings Microsoft’s Cortana AI to Your Living Room
Cortana virtual assistant already integrates into Windows 10, works on iOS and Android, and will start showing up in cars soon, it’s ready for your home with Invoke. It’s good for work, good for play, even has a cool name. The new Invoke speaker, made by Harman Kardon, is more or less a direct copy of the Amazon Echo – a tall, cylindrical speaker with a blue light at the top that glows when the speaker is listening to you. It can control some of your smart-home devices, set reminders,…
Enable and control iOS 11 Large Titles in Xamarin.Forms
Apple introduced with iOS 11 a new UI in particular for larger titles: if you open your email, you see at the top a large title. That sit in the Navigation Bar and can be scrolled away when more space is needed. We can enable large titles with a renderer. For this example, I only created a new project and added the following renderer in the iOS project under Renderers folder. You can easily add to all your solution the following renderer in your iOS project: using System; using YourProject.iOS.Renderers;…
UriBuilder in Xamarin Forms
In Xamarin Forms there is a native function called UriBuilder: it allow you to create a well-formed url. In my implementation, all parameters are in a Dictionary called parameters. Using Linq, I put in builder.Query only the parameters with a value. UriBuilder builder = new UriBuilder(yourUrl); Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add(“reference”, Reference); parameters.Add(“param1”, Param1); builder.Query = string.Join(“&”, parameters.Where(p => !string.IsNullOrWhiteSpace(p.Value)) .Select(p => string.Format(“{0}={1}”, Uri.EscapeDataString(p.Key), Uri.EscapeDataString(p.Value)))); return builder.ToString(); Happy coding!
Microsoft release new XAML Controls Gallery app to help developers implement Fluent Design
Microsoft is hoping developers will be updating their UWP apps en masse to support their new Fluent Design language, and to help them along Microsoft has published an app in the store that demonstrates all the controls available. “XAML Controls Gallery” demonstrates all of the controls available in Fluent Design System and XAML. It’s the interactive companion to the Fluent Design System web site which can be seen here. According to Microsoft, the new Microsoft Fluent Design System will deliver “intuitive, harmonious, responsive and inclusive cross-device experiences and interactions” for…
Binding FormattedString for Xamarin Forms
Xamarin Forms doesn’t have a Label with a Bindable FormattedString. For example, if you want a bindable bold word in the middle of a sentence in a Label, it’s very hard to design it with common control. For that, I create my own component for that. LabelRenderer.cs using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; using System.Runtime.CompilerServices; using Xamarin.Forms; namespace PSC.Controls { public class Label : Xamarin.Forms.Label { protected override void OnBindingContextChanged() { base.OnBindingContextChanged(); UpdateFormattedTextBindingContext(); } protected override void OnPropertyChanged( [CallerMemberName] string propertyName = null) { base.OnPropertyChanged(propertyName); if (propertyName ==…
Microsoft Launcher review: A beautiful Android experience
After Microsoft gives up on Windows 10 Mobile, Microsoft Launcher is the upgraded version of the Microsoft Garage project Arrow Launcher, and we covered the key changes that came with that upgrade last week. It’s free and can be picked up from the Google Play Store. After some heavy usage over the last few days, we’re breaking down what works, what doesn’t, and where Microsoft should take their launcher from here. As Microsoft Launcher gains more publicity, there have been some rumblings about how it doesn’t look like Windows 10…
Microsoft gives up on Windows 10 Mobile
The company’s Windows 10 chief has tweeted that developing new features and hardware for the Mobile version of the OS was no longer a "focus". Joe Belfiore added that he had also switched to Android himself. Windows 10 Mobile tried to attract users by letting them run the same "universal apps" on both their PCs and handsets, but the concept failed to catch on. The OS accounted for just 0.03% of the global market – based on smartphone shipments – between April and June, according to research company IDC. The…
Xamarin Forms Repeater View
A ListView is a kind of repeater but isn’t always what I want. It’s surprising something like this isn’t included in the framework but making your own is fairly simple. namespace PSC.Controls { /// <summary> /// Repeater view. /// </summary> public class RepeaterView : StackLayout { /// <summary> /// The item template property. /// </summary> public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create( “ItemTemplate”, typeof(DataTemplate), typeof(RepeaterView), null, propertyChanged: (bindable, value, newValue) => Populate(bindable)); /// <summary> /// The items source property. /// </summary> public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create( “ItemsSource”, typeof(IEnumerable),…