Xamarin.Forms: Coach Marks

2019-01-17 11_27_56-coach marks - Google Search.pngA Coach Mark is an overlay which helps teach a new user about a feature. This post will show you how to do it easily in Xamarin.Forms

Here’s the way the screen will look. You could replace the Text with an image, and a “Close” button is a good idea as well.

Image-1.jpg

Step 1:

Here’s a ContentView:


 
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
             xmlns:gestures="clr-namespace:MR.Gestures;assembly=MR.Gestures"
             x:Class="Max.Views.Common.CoachMarksView">
	<ContentView.Content>
		<gestures:Grid Tapped="Grid_OnTapped">
			<ContentView>
			<Frame
			       BackgroundColor="#000000"
			       Opacity="0.6"
			       Padding="0"
				   Margin="0"
			       HorizontalOptions="FillAndExpand"
			       IsVisible="true" 
			       VerticalOptions="FillAndExpand"  CornerRadius="0" />
			</ContentView>
			<Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"  >
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"></RowDefinition>
					<RowDefinition Height="*"></RowDefinition>
					<RowDefinition></RowDefinition>
				</Grid.RowDefinitions>
 
				<ffimageloading:CachedImage Grid.Row="0" x:Name="Image" CacheDuration="0" FadeAnimationEnabled="True"></ffimageloading:CachedImage>
			</Grid>
		</gestures:Grid>
	</ContentView.Content>
</ContentView>

Step 2: The Bindings

	public partial class CoachMarksView : ContentView
	{
		public CoachMarksView ()
		{
			InitializeComponent ();
		}
 
		public string CoachImageUrl
		{
			get { return (string)GetValue(CoachImageUrlProperty); }
			set { SetValue(CoachImageUrlProperty, value); }
		}
 
		public static readonly BindableProperty CoachImageUrlProperty =
			BindableProperty.Create(nameof(CoachImageUrl), typeof(string), typeof(CoachMarksView),
				propertyChanged: (bindable, oldValue, newValue) => ((CoachMarksView)bindable).PopulateCoachImageUrl());
 
 
		public EnumCoachMarkPosition CoachImagePosition
		{
			get { return (EnumCoachMarkPosition)GetValue(CoachImagePositionProperty); }  
			set { SetValue(CoachImagePositionProperty, value); }
		}
 
		public static readonly BindableProperty CoachImagePositionProperty =
			BindableProperty.Create(nameof(CoachImagePosition), typeof(EnumCoachMarkPosition), typeof(CoachMarksView),
				propertyChanged: (bindable, oldValue, newValue) => ((CoachMarksView)bindable).PopulateCoachImageUrl());
 
 
 
 
 
		void PopulateCoachImageUrl()
		{
			if(CoachImageUrl.HasValue()) this.Image.Source = CoachImageUrl;
 
			switch (CoachImagePosition)
			{
				case EnumCoachMarkPosition.TopRight:
					Image.HorizontalOptions=LayoutOptions.End;
					Image.VerticalOptions=LayoutOptions.Start;
					break;
				case EnumCoachMarkPosition.TopLeft:
					Image.HorizontalOptions=LayoutOptions.Start;
					Image.VerticalOptions=LayoutOptions.Start;
					break;
				case EnumCoachMarkPosition.BottomRight:
					Image.HorizontalOptions=LayoutOptions.End;
					Image.VerticalOptions=LayoutOptions.End;
					break;
				case EnumCoachMarkPosition.BottomLeft:
					Image.HorizontalOptions=LayoutOptions.Start;
					Image.VerticalOptions=LayoutOptions.End;
					break;
				default:
					throw new ArgumentOutOfRangeException();
			}
 
		}
 
		private void Grid_OnTapped(object sender, TapEventArgs e)
		{
			this.IsVisible = false;
		 
		}
	}

 

Advertisements

Xamarin: Search As You Type with Delay

download.jpgI have an Entry Textbox that searches as the user types. I don’t want the search on every letter, but rather wait 0.5 seconds between typing then search on what the current Query Text is. So as the user types the Query builds a string. That string is searched on every 0.5 seconds, not after every keystroke.

Let’s say the user types CANADA, here’s what happens:

C {WAIT}
CA {WAIT}
CAN  {Search}
CANA {WAIT}
CANAD {WAIT}
CANADA {SEARCH}

Here how:

In your XAML put a SearchBar with a Command (Behaviors):

<SearchBar Text="{Binding Query}" Placeholder="Search Address Book">
   <SearchBar.Behaviors>
      <behaviors:EventHandlerBehavior EventName="TextChanged">
	 <behaviors:InvokeCommandAction Command="{Binding RefreshCommand}" />
      </behaviors:EventHandlerBehavior>
    </SearchBar.Behaviors>
</SearchBar>

When the user types we store the Text in the Model’s Query property and call the RefreshCommand in the model for changes. This is a common way to do searches.

Here’s the magic you need to put into your Model (thanks to SO)

public ICommand RefreshCommand => 
       new Command(async () => { 
     await DelayedQueryForKeyboardTypingSearches().ConfigureAwait(false); });
private CancellationTokenSource throttleCts = new CancellationTokenSource();
/// <summary>
/// Runs in a background thread, checks for new Query and runs current one
/// </summary>
private async Task DelayedQueryForKeyboardTypingSearches()
{
  try
   {
     Interlocked.Exchange(ref this.throttleCts, new CancellationTokenSource()).Cancel();
      await Task.Delay(TimeSpan.FromMilliseconds(500), this.throttleCts.Token)
	.ContinueWith(async task => await Refresh()  , 
                  CancellationToken.None, 
                  TaskContinuationOptions.OnlyOnRanToCompletion, 
                  TaskScheduler.FromCurrentSynchronizationContext());
	}
	catch  
	{
		//Ignore any Threading errors
	}
    }
}

 

Google’s Material Font – C# Unicode Values

2018-08-22 09_57_48-Icons - Material Design.pngIf you use the Google Material Font and want to use it in Xamarin you’ll need to reference the values in c#. Here’s the list and the font:

https://material.io/tools/icons/?style=baseline

    public class MaterialFont
    {
		public const string threed_rotation = "\ue84d";
                public const string ac_unit = "\ueb3b";
		public const string access_alarm = "\ue190";
		public const string access_alarms = "\ue191";
		public const string access_time = "\ue192";
		public const string accessibility = "\ue84e";
		public const string accessible = "\ue914";
		public const string account_balance = "\ue84f";
		public const string account_balance_wallet = "\ue850";
		public const string account_box = "\ue851";
		public const string account_circle = "\ue853";
		public const string adb = "\ue60e";
		public const string add = "\ue145";
		public const string add_a_photo = "\ue439";
		public const string add_alarm = "\ue193";
		public const string add_alert = "\ue003";
		public const string add_box = "\ue146";
		public const string add_circle = "\ue147";
		public const string add_circle_outline = "\ue148";
		public const string add_location = "\ue567";
		public const string add_shopping_cart = "\ue854";
		public const string add_to_photos = "\ue39d";
		public const string add_to_queue = "\ue05c";
		public const string adjust = "\ue39e";
		public const string airline_seat_flat = "\ue630";
		public const string airline_seat_flat_angled = "\ue631";
		public const string airline_seat_individual_suite = "\ue632";
		public const string airline_seat_legroom_extra = "\ue633";
		public const string airline_seat_legroom_normal = "\ue634";
		public const string airline_seat_legroom_reduced = "\ue635";
		public const string airline_seat_recline_extra = "\ue636";
		public const string airline_seat_recline_normal = "\ue637";
		public const string airplanemode_active = "\ue195";
		public const string airplanemode_inactive = "\ue194";
		public const string airplay = "\ue055";
		public const string airport_shuttle = "\ueb3c";
		public const string alarm = "\ue855";
		public const string alarm_add = "\ue856";
		public const string alarm_off = "\ue857";
		public const string alarm_on = "\ue858";
		public const string album = "\ue019";
		public const string all_inclusive = "\ueb3d";
		public const string all_out = "\ue90b";
		public const string android = "\ue859";
		public const string announcement = "\ue85a";
		public const string apps = "\ue5c3";
		public const string archive = "\ue149";
		public const string arrow_back = "\ue5c4";
		public const string arrow_downward = "\ue5db";
		public const string arrow_drop_down = "\ue5c5";
		public const string arrow_drop_down_circle = "\ue5c6";
		public const string arrow_drop_up = "\ue5c7";
		public const string arrow_forward = "\ue5c8";
		public const string arrow_upward = "\ue5d8";
		public const string art_track = "\ue060";
		public const string aspect_ratio = "\ue85b";
		public const string assessment = "\ue85c";
		public const string assignment = "\ue85d";
		public const string assignment_ind = "\ue85e";
		public const string assignment_late = "\ue85f";
		public const string assignment_return = "\ue860";
		public const string assignment_returned = "\ue861";
		public const string assignment_turned_in = "\ue862";
		public const string assistant = "\ue39f";
		public const string assistant_photo = "\ue3a0";
		public const string attach_file = "\ue226";
		public const string attach_money = "\ue227";
		public const string attachment = "\ue2bc";
		public const string audiotrack = "\ue3a1";
		public const string autorenew = "\ue863";
		public const string av_timer = "\ue01b";
		public const string backspace = "\ue14a";
		public const string backup = "\ue864";
		public const string battery_alert = "\ue19c";
		public const string battery_charging_full = "\ue1a3";
		public const string battery_full = "\ue1a4";
		public const string battery_std = "\ue1a5";
		public const string battery_unknown = "\ue1a6";
		public const string beach_access = "\ueb3e";
		public const string beenhere = "\ue52d";
		public const string block = "\ue14b";
		public const string bluetooth = "\ue1a7";
		public const string bluetooth_audio = "\ue60f";
		public const string bluetooth_connected = "\ue1a8";
		public const string bluetooth_disabled = "\ue1a9";
		public const string bluetooth_searching = "\ue1aa";
		public const string blur_circular = "\ue3a2";
		public const string blur_linear = "\ue3a3";
		public const string blur_off = "\ue3a4";
		public const string blur_on = "\ue3a5";
		public const string book = "\ue865";
		public const string bookmark = "\ue866";
		public const string bookmark_border = "\ue867";
		public const string border_all = "\ue228";
		public const string border_bottom = "\ue229";
		public const string border_clear = "\ue22a";
		public const string border_color = "\ue22b";
		public const string border_horizontal = "\ue22c";
		public const string border_inner = "\ue22d";
		public const string border_left = "\ue22e";
		public const string border_outer = "\ue22f";
		public const string border_right = "\ue230";
		public const string border_style = "\ue231";
		public const string border_top = "\ue232";
		public const string border_vertical = "\ue233";
		public const string branding_watermark = "\ue06b";
		public const string brightness_1 = "\ue3a6";
		public const string brightness_2 = "\ue3a7";
		public const string brightness_3 = "\ue3a8";
		public const string brightness_4 = "\ue3a9";
		public const string brightness_5 = "\ue3aa";
		public const string brightness_6 = "\ue3ab";
		public const string brightness_7 = "\ue3ac";
		public const string brightness_auto = "\ue1ab";
		public const string brightness_high = "\ue1ac";
		public const string brightness_low = "\ue1ad";
		public const string brightness_medium = "\ue1ae";
		public const string broken_image = "\ue3ad";
		public const string brush = "\ue3ae";
		public const string bubble_chart = "\ue6dd";
		public const string bug_report = "\ue868";
		public const string build = "\ue869";
		public const string burst_mode = "\ue43c";
		public const string business = "\ue0af";
		public const string business_center = "\ueb3f";
		public const string cached = "\ue86a";
		public const string cake = "\ue7e9";
		public const string call = "\ue0b0";
		public const string call_end = "\ue0b1";
		public const string call_made = "\ue0b2";
		public const string call_merge = "\ue0b3";
		public const string call_missed = "\ue0b4";
		public const string call_missed_outgoing = "\ue0e4";
		public const string call_received = "\ue0b5";
		public const string call_split = "\ue0b6";
		public const string call_to_action = "\ue06c";
		public const string camera = "\ue3af";
		public const string camera_alt = "\ue3b0";
		public const string camera_enhance = "\ue8fc";
		public const string camera_front = "\ue3b1";
		public const string camera_rear = "\ue3b2";
		public const string camera_roll = "\ue3b3";
		public const string cancel = "\ue5c9";
		public const string card_giftcard = "\ue8f6";
		public const string card_membership = "\ue8f7";
		public const string card_travel = "\ue8f8";
		public const string casino = "\ueb40";
		public const string cast = "\ue307";
		public const string cast_connected = "\ue308";
		public const string center_focus_strong = "\ue3b4";
		public const string center_focus_weak = "\ue3b5";
		public const string change_history = "\ue86b";
		public const string chat = "\ue0b7";
		public const string chat_bubble = "\ue0ca";
		public const string chat_bubble_outline = "\ue0cb";
		public const string check = "\ue5ca";
		public const string check_box = "\ue834";
		public const string check_box_outline_blank = "\ue835";
		public const string check_circle = "\ue86c";
		public const string chevron_left = "\ue5cb";
		public const string chevron_right = "\ue5cc";
		public const string child_care = "\ueb41";
		public const string child_friendly = "\ueb42";
		public const string chrome_reader_mode = "\ue86d";
		public const string classclass = "\ue86e";
public const string clear = "\ue14c";
		public const string clear_all = "\ue0b8";
		public const string close = "\ue5cd";
		public const string closed_caption = "\ue01c";
		public const string cloud = "\ue2bd";
		public const string cloud_circle = "\ue2be";
		public const string cloud_done = "\ue2bf";
		public const string cloud_download = "\ue2c0";
		public const string cloud_off = "\ue2c1";
		public const string cloud_queue = "\ue2c2";
		public const string cloud_upload = "\ue2c3";
		public const string code = "\ue86f";
		public const string collections = "\ue3b6";
		public const string collections_bookmark = "\ue431";
		public const string color_lens = "\ue3b7";
		public const string colorize = "\ue3b8";
		public const string comment = "\ue0b9";
		public const string compare = "\ue3b9";
		public const string compare_arrows = "\ue915";
		public const string computer = "\ue30a";
		public const string confirmation_number = "\ue638";
		public const string contact_mail = "\ue0d0";
		public const string contact_phone = "\ue0cf";
		public const string contacts = "\ue0ba";
		public const string content_copy = "\ue14d";
		public const string content_cut = "\ue14e";
		public const string content_paste = "\ue14f";
		public const string control_point = "\ue3ba";
		public const string control_point_duplicate = "\ue3bb";
		public const string copyright = "\ue90c";
		public const string create = "\ue150";
		public const string create_new_folder = "\ue2cc";
		public const string credit_card = "\ue870";
		public const string crop = "\ue3be";
		public const string crop_16_9 = "\ue3bc";
		public const string crop_3_2 = "\ue3bd";
		public const string crop_5_4 = "\ue3bf";
		public const string crop_7_5 = "\ue3c0";
		public const string crop_din = "\ue3c1";
		public const string crop_free = "\ue3c2";
		public const string crop_landscape = "\ue3c3";
		public const string crop_original = "\ue3c4";
		public const string crop_portrait = "\ue3c5";
		public const string crop_rotate = "\ue437";
		public const string crop_square = "\ue3c6";
		public const string dashboard = "\ue871";
		public const string data_usage = "\ue1af";
		public const string date_range = "\ue916";
		public const string dehaze = "\ue3c7";
		public const string delete = "\ue872";
		public const string delete_forever = "\ue92b";
		public const string delete_sweep = "\ue16c";
		public const string description = "\ue873";
		public const string desktop_mac = "\ue30b";
		public const string desktop_windows = "\ue30c";
		public const string details = "\ue3c8";
		public const string developer_board = "\ue30d";
		public const string developer_mode = "\ue1b0";
		public const string device_hub = "\ue335";
		public const string devices = "\ue1b1";
		public const string devices_other = "\ue337";
		public const string dialer_sip = "\ue0bb";
		public const string dialpad = "\ue0bc";
		public const string directions = "\ue52e";
		public const string directions_bike = "\ue52f";
		public const string directions_boat = "\ue532";
		public const string directions_bus = "\ue530";
		public const string directions_car = "\ue531";
		public const string directions_railway = "\ue534";
		public const string directions_run = "\ue566";
		public const string directions_subway = "\ue533";
		public const string directions_transit = "\ue535";
		public const string directions_walk = "\ue536";
		public const string disc_full = "\ue610";
		public const string dns = "\ue875";
		public const string do_not_disturb = "\ue612";
		public const string do_not_disturb_alt = "\ue611";
		public const string do_not_disturb_off = "\ue643";
		public const string do_not_disturb_on = "\ue644";
		public const string dock = "\ue30e";
		public const string domain = "\ue7ee";
		public const string done = "\ue876";
		public const string done_all = "\ue877";
		public const string donut_large = "\ue917";
		public const string donut_small = "\ue918";
		public const string drafts = "\ue151";
		public const string drag_handle = "\ue25d";
		public const string drive_eta = "\ue613";
		public const string dvr = "\ue1b2";
		public const string edit = "\ue3c9";
		public const string edit_location = "\ue568";
		public const string eject = "\ue8fb";
		public const string email = "\ue0be";
		public const string enhanced_encryption = "\ue63f";
		public const string equalizer = "\ue01d";
		public const string error = "\ue000";
		public const string error_outline = "\ue001";
		public const string euro_symbol = "\ue926";
		public const string ev_station = "\ue56d";
		public const string eventevent = "\ue878";
public const string event_available = "\ue614";
		public const string event_busy = "\ue615";
		public const string event_note = "\ue616";
		public const string event_seat = "\ue903";
		public const string exit_to_app = "\ue879";
		public const string expand_less = "\ue5ce";
		public const string expand_more = "\ue5cf";
		public const string explicitexplicit = "\ue01e";
public const string explore = "\ue87a";
		public const string exposure = "\ue3ca";
		public const string exposure_neg_1 = "\ue3cb";
		public const string exposure_neg_2 = "\ue3cc";
		public const string exposure_plus_1 = "\ue3cd";
		public const string exposure_plus_2 = "\ue3ce";
		public const string exposure_zero = "\ue3cf";
		public const string extension = "\ue87b";
		public const string face = "\ue87c";
		public const string fast_forward = "\ue01f";
		public const string fast_rewind = "\ue020";
		public const string favorite = "\ue87d";
		public const string favorite_border = "\ue87e";
		public const string featured_play_list = "\ue06d";
		public const string featured_video = "\ue06e";
		public const string feedback = "\ue87f";
		public const string fiber_dvr = "\ue05d";
		public const string fiber_manual_record = "\ue061";
		public const string fiber_new = "\ue05e";
		public const string fiber_pin = "\ue06a";
		public const string fiber_smart_record = "\ue062";
		public const string file_download = "\ue2c4";
		public const string file_upload = "\ue2c6";
		public const string filter = "\ue3d3";
		public const string filter_1 = "\ue3d0";
		public const string filter_2 = "\ue3d1";
		public const string filter_3 = "\ue3d2";
		public const string filter_4 = "\ue3d4";
		public const string filter_5 = "\ue3d5";
		public const string filter_6 = "\ue3d6";
		public const string filter_7 = "\ue3d7";
		public const string filter_8 = "\ue3d8";
		public const string filter_9 = "\ue3d9";
		public const string filter_9_plus = "\ue3da";
		public const string filter_b_and_w = "\ue3db";
		public const string filter_center_focus = "\ue3dc";
		public const string filter_drama = "\ue3dd";
		public const string filter_frames = "\ue3de";
		public const string filter_hdr = "\ue3df";
		public const string filter_list = "\ue152";
		public const string filter_none = "\ue3e0";
		public const string filter_tilt_shift = "\ue3e2";
		public const string filter_vintage = "\ue3e3";
		public const string find_in_page = "\ue880";
		public const string find_replace = "\ue881";
		public const string fingerprint = "\ue90d";
		public const string first_page = "\ue5dc";
		public const string fitness_center = "\ueb43";
		public const string flag = "\ue153";
		public const string flare = "\ue3e4";
		public const string flash_auto = "\ue3e5";
		public const string flash_off = "\ue3e6";
		public const string flash_on = "\ue3e7";
		public const string flight = "\ue539";
		public const string flight_land = "\ue904";
		public const string flight_takeoff = "\ue905";
		public const string flip = "\ue3e8";
		public const string flip_to_back = "\ue882";
		public const string flip_to_front = "\ue883";
		public const string folder = "\ue2c7";
		public const string folder_open = "\ue2c8";
		public const string folder_shared = "\ue2c9";
		public const string folder_special = "\ue617";
		public const string font_download = "\ue167";
		public const string format_align_center = "\ue234";
		public const string format_align_justify = "\ue235";
		public const string format_align_left = "\ue236";
		public const string format_align_right = "\ue237";
		public const string format_bold = "\ue238";
		public const string format_clear = "\ue239";
		public const string format_color_fill = "\ue23a";
		public const string format_color_reset = "\ue23b";
		public const string format_color_text = "\ue23c";
		public const string format_indent_decrease = "\ue23d";
		public const string format_indent_increase = "\ue23e";
		public const string format_italic = "\ue23f";
		public const string format_line_spacing = "\ue240";
		public const string format_list_bulleted = "\ue241";
		public const string format_list_numbered = "\ue242";
		public const string format_paint = "\ue243";
		public const string format_quote = "\ue244";
		public const string format_shapes = "\ue25e";
		public const string format_size = "\ue245";
		public const string format_strikethrough = "\ue246";
		public const string format_textdirection_l_to_r = "\ue247";
		public const string format_textdirection_r_to_l = "\ue248";
		public const string format_underlined = "\ue249";
		public const string forum = "\ue0bf";
		public const string forward = "\ue154";
		public const string forward_10 = "\ue056";
		public const string forward_30 = "\ue057";
		public const string forward_5 = "\ue058";
		public const string free_breakfast = "\ueb44";
		public const string fullscreen = "\ue5d0";
		public const string fullscreen_exit = "\ue5d1";
		public const string functions = "\ue24a";
		public const string g_translate = "\ue927";
		public const string gamepad = "\ue30f";
		public const string games = "\ue021";
		public const string gavel = "\ue90e";
		public const string gesture = "\ue155";
		public const string get_app = "\ue884";
		public const string gif = "\ue908";
		public const string golf_course = "\ueb45";
		public const string gps_fixed = "\ue1b3";
		public const string gps_not_fixed = "\ue1b4";
		public const string gps_off = "\ue1b5";
		public const string grade = "\ue885";
		public const string gradient = "\ue3e9";
		public const string grain = "\ue3ea";
		public const string graphic_eq = "\ue1b8";
		public const string grid_off = "\ue3eb";
		public const string grid_on = "\ue3ec";
		public const string group = "\ue7ef";
		public const string group_add = "\ue7f0";
		public const string group_work = "\ue886";
		public const string hd = "\ue052";
		public const string hdr_off = "\ue3ed";
		public const string hdr_on = "\ue3ee";
		public const string hdr_strong = "\ue3f1";
		public const string hdr_weak = "\ue3f2";
		public const string headset = "\ue310";
		public const string headset_mic = "\ue311";
		public const string healing = "\ue3f3";
		public const string hearing = "\ue023";
		public const string help = "\ue887";
		public const string help_outline = "\ue8fd";
		public const string high_quality = "\ue024";
		public const string highlight = "\ue25f";
		public const string highlight_off = "\ue888";
		public const string history = "\ue889";
		public const string home = "\ue88a";
		public const string hot_tub = "\ueb46";
		public const string hotel = "\ue53a";
		public const string hourglass_empty = "\ue88b";
		public const string hourglass_full = "\ue88c";
		public const string http = "\ue902";
		public const string https = "\ue88d";
		public const string image = "\ue3f4";
		public const string image_aspect_ratio = "\ue3f5";
		public const string import_contacts = "\ue0e0";
		public const string import_export = "\ue0c3";
		public const string important_devices = "\ue912";
		public const string inbox = "\ue156";
		public const string indeterminate_check_box = "\ue909";
		public const string info = "\ue88e";
		public const string info_outline = "\ue88f";
		public const string input = "\ue890";
		public const string insert_chart = "\ue24b";
		public const string insert_comment = "\ue24c";
		public const string insert_drive_file = "\ue24d";
		public const string insert_emoticon = "\ue24e";
		public const string insert_invitation = "\ue24f";
		public const string insert_link = "\ue250";
		public const string insert_photo = "\ue251";
		public const string invert_colors = "\ue891";
		public const string invert_colors_off = "\ue0c4";
		public const string iso = "\ue3f6";
		public const string keyboard = "\ue312";
		public const string keyboard_arrow_down = "\ue313";
		public const string keyboard_arrow_left = "\ue314";
		public const string keyboard_arrow_right = "\ue315";
		public const string keyboard_arrow_up = "\ue316";
		public const string keyboard_backspace = "\ue317";
		public const string keyboard_capslock = "\ue318";
		public const string keyboard_hide = "\ue31a";
		public const string keyboard_return = "\ue31b";
		public const string keyboard_tab = "\ue31c";
		public const string keyboard_voice = "\ue31d";
		public const string kitchen = "\ueb47";
		public const string label = "\ue892";
		public const string label_outline = "\ue893";
		public const string landscape = "\ue3f7";
		public const string language = "\ue894";
		public const string laptop = "\ue31e";
		public const string laptop_chromebook = "\ue31f";
		public const string laptop_mac = "\ue320";
		public const string laptop_windows = "\ue321";
		public const string last_page = "\ue5dd";
		public const string launch = "\ue895";
		public const string layers = "\ue53b";
		public const string layers_clear = "\ue53c";
		public const string leak_add = "\ue3f8";
		public const string leak_remove = "\ue3f9";
		public const string lens = "\ue3fa";
		public const string library_add = "\ue02e";
		public const string library_books = "\ue02f";
		public const string library_music = "\ue030";
		public const string lightbulb_outline = "\ue90f";
		public const string line_style = "\ue919";
		public const string line_weight = "\ue91a";
		public const string linear_scale = "\ue260";
		public const string link = "\ue157";
		public const string linked_camera = "\ue438";
		public const string list = "\ue896";
		public const string live_help = "\ue0c6";
		public const string live_tv = "\ue639";
		public const string local_activity = "\ue53f";
		public const string local_airport = "\ue53d";
		public const string local_atm = "\ue53e";
		public const string local_bar = "\ue540";
		public const string local_cafe = "\ue541";
		public const string local_car_wash = "\ue542";
		public const string local_convenience_store = "\ue543";
		public const string local_dining = "\ue556";
		public const string local_drink = "\ue544";
		public const string local_florist = "\ue545";
		public const string local_gas_station = "\ue546";
		public const string local_grocery_store = "\ue547";
		public const string local_hospital = "\ue548";
		public const string local_hotel = "\ue549";
		public const string local_laundry_service = "\ue54a";
		public const string local_library = "\ue54b";
		public const string local_mall = "\ue54c";
		public const string local_movies = "\ue54d";
		public const string local_offer = "\ue54e";
		public const string local_parking = "\ue54f";
		public const string local_pharmacy = "\ue550";
		public const string local_phone = "\ue551";
		public const string local_pizza = "\ue552";
		public const string local_play = "\ue553";
		public const string local_post_office = "\ue554";
		public const string local_printshop = "\ue555";
		public const string local_see = "\ue557";
		public const string local_shipping = "\ue558";
		public const string local_taxi = "\ue559";
		public const string location_city = "\ue7f1";
		public const string location_disabled = "\ue1b6";
		public const string location_off = "\ue0c7";
		public const string location_on = "\ue0c8";
		public const string location_searching = "\ue1b7";
		public const string locklock = "\ue897";
		public const string lock_open = "\ue898";
		public const string lock_outline = "\ue899";
		public const string looks = "\ue3fc";
		public const string looks_3 = "\ue3fb";
		public const string looks_4 = "\ue3fd";
		public const string looks_5 = "\ue3fe";
		public const string looks_6 = "\ue3ff";
		public const string looks_one = "\ue400";
		public const string looks_two = "\ue401";
		public const string loop = "\ue028";
		public const string loupe = "\ue402";
		public const string low_priority = "\ue16d";
		public const string loyalty = "\ue89a";
		public const string mail = "\ue158";
		public const string mail_outline = "\ue0e1";
		public const string map = "\ue55b";
		public const string markunread = "\ue159";
		public const string markunread_mailbox = "\ue89b";
		public const string memory = "\ue322";
		public const string menu = "\ue5d2";
		public const string merge_type = "\ue252";
		public const string message = "\ue0c9";
		public const string mic = "\ue029";
		public const string mic_none = "\ue02a";
		public const string mic_off = "\ue02b";
		public const string mms = "\ue618";
		public const string mode_comment = "\ue253";
		public const string mode_edit = "\ue254";
		public const string monetization_on = "\ue263";
		public const string money_off = "\ue25c";
		public const string monochrome_photos = "\ue403";
		public const string mood = "\ue7f2";
		public const string mood_bad = "\ue7f3";
		public const string more = "\ue619";
		public const string more_horiz = "\ue5d3";
		public const string more_vert = "\ue5d4";
		public const string motorcycle = "\ue91b";
		public const string mouse = "\ue323";
		public const string move_to_inbox = "\ue168";
		public const string movie = "\ue02c";
		public const string movie_creation = "\ue404";
		public const string movie_filter = "\ue43a";
		public const string multiline_chart = "\ue6df";
		public const string music_note = "\ue405";
		public const string music_video = "\ue063";
		public const string my_location = "\ue55c";
		public const string nature = "\ue406";
		public const string nature_people = "\ue407";
		public const string navigate_before = "\ue408";
		public const string navigate_next = "\ue409";
		public const string navigation = "\ue55d";
		public const string near_me = "\ue569";
		public const string network_cell = "\ue1b9";
		public const string network_check = "\ue640";
		public const string network_locked = "\ue61a";
		public const string network_wifi = "\ue1ba";
		public const string new_releases = "\ue031";
		public const string next_week = "\ue16a";
		public const string nfc = "\ue1bb";
		public const string no_encryption = "\ue641";
		public const string no_sim = "\ue0cc";
		public const string not_interested = "\ue033";
		public const string note = "\ue06f";
		public const string note_add = "\ue89c";
		public const string notifications = "\ue7f4";
		public const string notifications_active = "\ue7f7";
		public const string notifications_none = "\ue7f5";
		public const string notifications_off = "\ue7f6";
		public const string notifications_paused = "\ue7f8";
		public const string offline_pin = "\ue90a";
		public const string ondemand_video = "\ue63a";
		public const string opacity = "\ue91c";
		public const string open_in_browser = "\ue89d";
		public const string open_in_new = "\ue89e";
		public const string open_with = "\ue89f";
		public const string pages = "\ue7f9";
		public const string pageview = "\ue8a0";
		public const string palette = "\ue40a";
		public const string pan_tool = "\ue925";
		public const string panorama = "\ue40b";
		public const string panorama_fish_eye = "\ue40c";
		public const string panorama_horizontal = "\ue40d";
		public const string panorama_vertical = "\ue40e";
		public const string panorama_wide_angle = "\ue40f";
		public const string party_mode = "\ue7fa";
		public const string pause = "\ue034";
		public const string pause_circle_filled = "\ue035";
		public const string pause_circle_outline = "\ue036";
		public const string payment = "\ue8a1";
		public const string people = "\ue7fb";
		public const string people_outline = "\ue7fc";
		public const string perm_camera_mic = "\ue8a2";
		public const string perm_contact_calendar = "\ue8a3";
		public const string perm_data_setting = "\ue8a4";
		public const string perm_device_information = "\ue8a5";
		public const string perm_identity = "\ue8a6";
		public const string perm_media = "\ue8a7";
		public const string perm_phone_msg = "\ue8a8";
		public const string perm_scan_wifi = "\ue8a9";
		public const string person = "\ue7fd";
		public const string person_add = "\ue7fe";
		public const string person_outline = "\ue7ff";
		public const string person_pin = "\ue55a";
		public const string person_pin_circle = "\ue56a";
		public const string personal_video = "\ue63b";
		public const string pets = "\ue91d";
		public const string phone = "\ue0cd";
		public const string phone_android = "\ue324";
		public const string phone_bluetooth_speaker = "\ue61b";
		public const string phone_forwarded = "\ue61c";
		public const string phone_in_talk = "\ue61d";
		public const string phone_iphone = "\ue325";
		public const string phone_locked = "\ue61e";
		public const string phone_missed = "\ue61f";
		public const string phone_paused = "\ue620";
		public const string phonelink = "\ue326";
		public const string phonelink_erase = "\ue0db";
		public const string phonelink_lock = "\ue0dc";
		public const string phonelink_off = "\ue327";
		public const string phonelink_ring = "\ue0dd";
		public const string phonelink_setup = "\ue0de";
		public const string photo = "\ue410";
		public const string photo_album = "\ue411";
		public const string photo_camera = "\ue412";
		public const string photo_filter = "\ue43b";
		public const string photo_library = "\ue413";
		public const string photo_size_select_actual = "\ue432";
		public const string photo_size_select_large = "\ue433";
		public const string photo_size_select_small = "\ue434";
		public const string picture_as_pdf = "\ue415";
		public const string picture_in_picture = "\ue8aa";
		public const string picture_in_picture_alt = "\ue911";
		public const string pie_chart = "\ue6c4";
		public const string pie_chart_outlined = "\ue6c5";
		public const string pin_drop = "\ue55e";
		public const string place = "\ue55f";
		public const string play_arrow = "\ue037";
		public const string play_circle_filled = "\ue038";
		public const string play_circle_outline = "\ue039";
		public const string play_for_work = "\ue906";
		public const string playlist_add = "\ue03b";
		public const string playlist_add_check = "\ue065";
		public const string playlist_play = "\ue05f";
		public const string plus_one = "\ue800";
		public const string poll = "\ue801";
		public const string polymer = "\ue8ab";
		public const string pool = "\ueb48";
		public const string portable_wifi_off = "\ue0ce";
		public const string portrait = "\ue416";
		public const string power = "\ue63c";
		public const string power_input = "\ue336";
		public const string power_settings_new = "\ue8ac";
		public const string pregnant_woman = "\ue91e";
		public const string present_to_all = "\ue0df";
		public const string print = "\ue8ad";
		public const string priority_high = "\ue645";
		public const string publicpublic = "\ue80b";
public const string publish = "\ue255";
		public const string query_builder = "\ue8ae";
		public const string question_answer = "\ue8af";
		public const string queue = "\ue03c";
		public const string queue_music = "\ue03d";
		public const string queue_play_next = "\ue066";
		public const string radio = "\ue03e";
		public const string radio_button_checked = "\ue837";
		public const string radio_button_unchecked = "\ue836";
		public const string rate_review = "\ue560";
		public const string receipt = "\ue8b0";
		public const string recent_actors = "\ue03f";
		public const string record_voice_over = "\ue91f";
		public const string redeem = "\ue8b1";
		public const string redo = "\ue15a";
		public const string refresh = "\ue5d5";
		public const string remove = "\ue15b";
		public const string remove_circle = "\ue15c";
		public const string remove_circle_outline = "\ue15d";
		public const string remove_from_queue = "\ue067";
		public const string remove_red_eye = "\ue417";
		public const string remove_shopping_cart = "\ue928";
		public const string reorder = "\ue8fe";
		public const string repeat = "\ue040";
		public const string repeat_one = "\ue041";
		public const string replay = "\ue042";
		public const string replay_10 = "\ue059";
		public const string replay_30 = "\ue05a";
		public const string replay_5 = "\ue05b";
		public const string reply = "\ue15e";
		public const string reply_all = "\ue15f";
		public const string report = "\ue160";
		public const string report_problem = "\ue8b2";
		public const string restaurant = "\ue56c";
		public const string restaurant_menu = "\ue561";
		public const string restore = "\ue8b3";
		public const string restore_page = "\ue929";
		public const string ring_volume = "\ue0d1";
		public const string room = "\ue8b4";
		public const string room_service = "\ueb49";
		public const string rotate_90_degrees_ccw = "\ue418";
		public const string rotate_left = "\ue419";
		public const string rotate_right = "\ue41a";
		public const string rounded_corner = "\ue920";
		public const string router = "\ue328";
		public const string rowing = "\ue921";
		public const string rss_feed = "\ue0e5";
		public const string rv_hookup = "\ue642";
		public const string satellite = "\ue562";
		public const string save = "\ue161";
		public const string scanner = "\ue329";
		public const string schedule = "\ue8b5";
		public const string school = "\ue80c";
		public const string screen_lock_landscape = "\ue1be";
		public const string screen_lock_portrait = "\ue1bf";
		public const string screen_lock_rotation = "\ue1c0";
		public const string screen_rotation = "\ue1c1";
		public const string screen_share = "\ue0e2";
		public const string sd_card = "\ue623";
		public const string sd_storage = "\ue1c2";
		public const string search = "\ue8b6";
		public const string security = "\ue32a";
		public const string select_all = "\ue162";
		public const string send = "\ue163";
		public const string sentiment_dissatisfied = "\ue811";
		public const string sentiment_neutral = "\ue812";
		public const string sentiment_satisfied = "\ue813";
		public const string sentiment_very_dissatisfied = "\ue814";
		public const string sentiment_very_satisfied = "\ue815";
		public const string settings = "\ue8b8";
		public const string settings_applications = "\ue8b9";
		public const string settings_backup_restore = "\ue8ba";
		public const string settings_bluetooth = "\ue8bb";
		public const string settings_brightness = "\ue8bd";
		public const string settings_cell = "\ue8bc";
		public const string settings_ethernet = "\ue8be";
		public const string settings_input_antenna = "\ue8bf";
		public const string settings_input_component = "\ue8c0";
		public const string settings_input_composite = "\ue8c1";
		public const string settings_input_hdmi = "\ue8c2";
		public const string settings_input_svideo = "\ue8c3";
		public const string settings_overscan = "\ue8c4";
		public const string settings_phone = "\ue8c5";
		public const string settings_power = "\ue8c6";
		public const string settings_remote = "\ue8c7";
		public const string settings_system_daydream = "\ue1c3";
		public const string settings_voice = "\ue8c8";
		public const string share = "\ue80d";
		public const string shop = "\ue8c9";
		public const string shop_two = "\ue8ca";
		public const string shopping_basket = "\ue8cb";
		public const string shopping_cart = "\ue8cc";
		public const string short_text = "\ue261";
		public const string show_chart = "\ue6e1";
		public const string shuffle = "\ue043";
		public const string signal_cellular_4_bar = "\ue1c8";
		public const string signal_cellular_connected_no_internet_4_bar = "\ue1cd";
		public const string signal_cellular_no_sim = "\ue1ce";
		public const string signal_cellular_null = "\ue1cf";
		public const string signal_cellular_off = "\ue1d0";
		public const string signal_wifi_4_bar = "\ue1d8";
		public const string signal_wifi_4_bar_lock = "\ue1d9";
		public const string signal_wifi_off = "\ue1da";
		public const string sim_card = "\ue32b";
		public const string sim_card_alert = "\ue624";
		public const string skip_next = "\ue044";
		public const string skip_previous = "\ue045";
		public const string slideshow = "\ue41b";
		public const string slow_motion_video = "\ue068";
		public const string smartphone = "\ue32c";
		public const string smoke_free = "\ueb4a";
		public const string smoking_rooms = "\ueb4b";
		public const string sms = "\ue625";
		public const string sms_failed = "\ue626";
		public const string snooze = "\ue046";
		public const string sort = "\ue164";
		public const string sort_by_alpha = "\ue053";
		public const string spa = "\ueb4c";
		public const string space_bar = "\ue256";
		public const string speaker = "\ue32d";
		public const string speaker_group = "\ue32e";
		public const string speaker_notes = "\ue8cd";
		public const string speaker_notes_off = "\ue92a";
		public const string speaker_phone = "\ue0d2";
		public const string spellcheck = "\ue8ce";
		public const string star = "\ue838";
		public const string star_border = "\ue83a";
		public const string star_half = "\ue839";
		public const string stars = "\ue8d0";
		public const string stay_current_landscape = "\ue0d3";
		public const string stay_current_portrait = "\ue0d4";
		public const string stay_primary_landscape = "\ue0d5";
		public const string stay_primary_portrait = "\ue0d6";
		public const string stop = "\ue047";
		public const string stop_screen_share = "\ue0e3";
		public const string storage = "\ue1db";
		public const string store = "\ue8d1";
		public const string store_mall_directory = "\ue563";
		public const string straighten = "\ue41c";
		public const string streetview = "\ue56e";
		public const string strikethrough_s = "\ue257";
		public const string style = "\ue41d";
		public const string subdirectory_arrow_left = "\ue5d9";
		public const string subdirectory_arrow_right = "\ue5da";
		public const string subject = "\ue8d2";
		public const string subscriptions = "\ue064";
		public const string subtitles = "\ue048";
		public const string subway = "\ue56f";
		public const string supervisor_account = "\ue8d3";
		public const string surround_sound = "\ue049";
		public const string swap_calls = "\ue0d7";
		public const string swap_horiz = "\ue8d4";
		public const string swap_vert = "\ue8d5";
		public const string swap_vertical_circle = "\ue8d6";
		public const string switch_camera = "\ue41e";
		public const string switch_video = "\ue41f";
		public const string sync = "\ue627";
		public const string sync_disabled = "\ue628";
		public const string sync_problem = "\ue629";
		public const string system_update = "\ue62a";
		public const string system_update_alt = "\ue8d7";
		public const string tab = "\ue8d8";
		public const string tab_unselected = "\ue8d9";
		public const string tablet = "\ue32f";
		public const string tablet_android = "\ue330";
		public const string tablet_mac = "\ue331";
		public const string tag_faces = "\ue420";
		public const string tap_and_play = "\ue62b";
		public const string terrain = "\ue564";
		public const string text_fields = "\ue262";
		public const string text_format = "\ue165";
		public const string textsms = "\ue0d8";
		public const string texture = "\ue421";
		public const string theaters = "\ue8da";
		public const string thumb_down = "\ue8db";
		public const string thumb_up = "\ue8dc";
		public const string thumbs_up_down = "\ue8dd";
		public const string time_to_leave = "\ue62c";
		public const string timelapse = "\ue422";
		public const string timeline = "\ue922";
		public const string timer = "\ue425";
		public const string timer_10 = "\ue423";
		public const string timer_3 = "\ue424";
		public const string timer_off = "\ue426";
		public const string title = "\ue264";
		public const string toc = "\ue8de";
		public const string today = "\ue8df";
		public const string toll = "\ue8e0";
		public const string tonality = "\ue427";
		public const string touch_app = "\ue913";
		public const string toys = "\ue332";
		public const string track_changes = "\ue8e1";
		public const string traffic = "\ue565";
		public const string train = "\ue570";
		public const string tram = "\ue571";
		public const string transfer_within_a_station = "\ue572";
		public const string transform = "\ue428";
		public const string translate = "\ue8e2";
		public const string trending_down = "\ue8e3";
		public const string trending_flat = "\ue8e4";
		public const string trending_up = "\ue8e5";
		public const string tune = "\ue429";
		public const string turned_in = "\ue8e6";
		public const string turned_in_not = "\ue8e7";
		public const string tv = "\ue333";
		public const string unarchive = "\ue169";
		public const string undo = "\ue166";
		public const string unfold_less = "\ue5d6";
		public const string unfold_more = "\ue5d7";
		public const string update = "\ue923";
		public const string usb = "\ue1e0";
		public const string verified_user = "\ue8e8";
		public const string vertical_align_bottom = "\ue258";
		public const string vertical_align_center = "\ue259";
		public const string vertical_align_top = "\ue25a";
		public const string vibration = "\ue62d";
		public const string video_call = "\ue070";
		public const string video_label = "\ue071";
		public const string video_library = "\ue04a";
		public const string videocam = "\ue04b";
		public const string videocam_off = "\ue04c";
		public const string videogame_asset = "\ue338";
		public const string view_agenda = "\ue8e9";
		public const string view_array = "\ue8ea";
		public const string view_carousel = "\ue8eb";
		public const string view_column = "\ue8ec";
		public const string view_comfy = "\ue42a";
		public const string view_compact = "\ue42b";
		public const string view_day = "\ue8ed";
		public const string view_headline = "\ue8ee";
		public const string view_list = "\ue8ef";
		public const string view_module = "\ue8f0";
		public const string view_quilt = "\ue8f1";
		public const string view_stream = "\ue8f2";
		public const string view_week = "\ue8f3";
		public const string vignette = "\ue435";
		public const string visibility = "\ue8f4";
		public const string visibility_off = "\ue8f5";
		public const string voice_chat = "\ue62e";
		public const string voicemail = "\ue0d9";
		public const string volume_down = "\ue04d";
		public const string volume_mute = "\ue04e";
		public const string volume_off = "\ue04f";
		public const string volume_up = "\ue050";
		public const string vpn_key = "\ue0da";
		public const string vpn_lock = "\ue62f";
		public const string wallpaper = "\ue1bc";
		public const string warning = "\ue002";
		public const string watch = "\ue334";
		public const string watch_later = "\ue924";
		public const string wb_auto = "\ue42c";
		public const string wb_cloudy = "\ue42d";
		public const string wb_incandescent = "\ue42e";
		public const string wb_iridescent = "\ue436";
		public const string wb_sunny = "\ue430";
		public const string wc = "\ue63d";
		public const string web = "\ue051";
		public const string web_asset = "\ue069";
		public const string weekend = "\ue16b";
		public const string whatshot = "\ue80e";
		public const string widgets = "\ue1bd";
		public const string wifi = "\ue63e";
		public const string wifi_lock = "\ue1e1";
		public const string wifi_tethering = "\ue1e2";
		public const string work = "\ue8f9";
		public const string wrap_text = "\ue25b";
		public const string youtube_searched_for = "\ue8fa";
		public const string zoom_in = "\ue8ff";
		public const string zoom_out = "\ue900";
		public const string zoom_out_map = "\ue56b";
 
 
	}

 

Xamarin Platform Specifics

2018-07-29 17_18_45-android mustache - Google Search.pngThere are many ways to customize a Xamarin app for a specific platform. One of the easiest is a tool called, “Platform Specifics”. These are tools the Xamarin Forms team has baked into Xamarin which are super popular.

In this example, we’ll use an Android Platform Specific to color and push a Tabbed Page to the bottom of the page.

Once we add the namespace for AndroidSpecifics, we simply reference the ToobarPlacement and other Android specific fields.

<?xml version="1.0" encoding="utf-8"?>
 
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:local="clr-namespace:DeltMeForms"
            xmlns:a="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
            BarBackgroundColor="#ff00FF00"
            x:Class="DeltMeForms.MainPage" 
            a:TabbedPage.BarSelectedItemColor="#ff000000"
            a:TabbedPage.BarItemColor="#33FF00FF" 
            a:TabbedPage.ToolbarPlacement="Bottom">
 
    <TabbedPage.Children>
        <NavigationPage Title="Hi">
            <x:Arguments>
                <local:Page1> </local:Page1>
            </x:Arguments>
        </NavigationPage>
    </TabbedPage.Children>
 
</TabbedPage>
 
 
 

 

Creating a Resiliant API call with Retry

Polly-Logo@2x.pngSometimes when we call an API over HTTP it fails and needs to be re-tried. Using Polly I’ll show you a simple way to implement a retry strategy.

Here’s a simple API call that will fail half the time.

public class Api
{
    Random rnd = new Random(DateTime.Now.Millisecond);
    public async Task<stringGetHtml(string url)
    {
        if (rnd.Next(1,10)<5)
        {
            url = "http://sdsdfsdfsdfsdfsdfsdfsdf.com";
        }
        return await new HttpClient().GetStringAsync(url);
    }
}

Let’s add the Polly Nuget package and then change the API to this:

public class Api
{
    public async Task<stringGetHtml(string url)
    {
        var policyResult = await Policy<string>
            .Handle<HttpRequestException>()
            .WaitAndRetryAsync(5, retryNumber => TimeSpan.FromSeconds(.5))
            .ExecuteAndCaptureAsync(async () => await DoTheActualWork(url));
 
        return policyResult.Result;
    }
 
    Random rnd = new Random(DateTime.Now.Millisecond);
    public async Task<stringDoTheActualWork(string url)
    {
        if (rnd.Next(1,10)<5)
        {
            url = "http://asdfasdfasdfsdf.com";
        }
        return await new HttpClient().GetStringAsync(url);
    }
}

We added a wrapper around GetHtml() It will retry the call 5 times if it gets a HttpRequestException.

In actual implementation you’ll want to check for Status codes or other failure conditions.

There’s a lot more you can add with Polly like checking for values in the result:

var policyResult = await Policy<string>
    .Handle<HttpRequestException>()
    .Or<ArgumentException>()
    .OrResult(s=>s.Contains("We are sorry, the page you requested cannot be found."))
    .WaitAndRetryAsync(16, retryNumber => TimeSpan.FromSeconds(.5))
    .ExecuteAndCaptureAsync(async () => await DoTheActualWork(url));

 

Live Reload from Visual Studio 2017 for Windows in WMWare Fusion on a Mac – Xamarin

main-qimg-2f9592a9947bee2a14921ac6cadfe091If you’re one of those people with a Mac but LOVE Visual Studio for Windows, here’s how you can set up Live Reload to work.

As you may know the Android Emulator can’t run in VMWare fusion, so you need to connect to it. Here’s how.

First install the Visual Studio for Windows Live Reload Extention and the Nuget package into your app as per instructions on the Live Reload site.

Here are the tweeks needed after that.

In your App.xaml.cs add this line at the top, DO NOT add any MQTT settings:

public partial class App : Application
 {
   public App()
    {
#if DEBUG
       LiveReload.Init();
#endif


Open Tools – Options then add the Hostname and unselect the checkbox as in the picture below.
live

Rebuild and redeploy the app to Android and iOS.

Now you can edit XAML and see changes live in both at the same time (mind blowen)