Skip to content

Instantly share code, notes, and snippets.

public class UIHelpers
{
MyPage view;
public UIHelpers()
{
if(!Forms.IsInitialized)
Forms.Init();
view = new MyPage();
}
public class MyPage : ContentPage
{
public MyPage()
{
var button = new Button
{
Text = "Click Me!",
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
};
/// <summary>
/// Enable or disable shift mode on bottom navigation view
/// </summary>
/// <param name="bottomNavigationView"></param>
/// <param name="enabled"></param>
public static void SetShiftMode(this BottomNavigationView bottomNavigationView, bool enableShiftMode, bool enableItemShiftMode)
{
try
{
var menuView = bottomNavigationView.GetChildAt(0) as BottomNavigationMenuView;
<ads:AdControlView x:Name="AdControl" Grid.Row="1"/>
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.UWP;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Advertising.Ads;
using Microsoft.Advertising.WinRT.UI;
using Windows.System.Profile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PluginsForXamarin.Controls
{
public class AdControlView : Xamarin.Forms.View
{
if(!CrossGeolocator.IsSupported)
return;
var position = await CrossGeolocator.Current.GetPositionAsync(TimeSpan.FromSeconds(10));
@jamesmontemagno
jamesmontemagno / XamarinLivePlayerChangelog.md
Last active February 7, 2018 18:04
Changelog for Xamrain Live Player

Release 1.4.X

  • Support for Xamarin.Forms 2.5.0
  • Edge to Edge Device Optimizations
  • Fix for Media.Compat not syncing
  • Updates for Photo Permissions
  • Debug Log is persisted between launches
  • Fix for BigInteger in .NET Standard Library
  • Fix for connection when using tethered on Android
  • Update feedback process
  • Additional IP Fixes
//Note that in the appdelegate I did call Forms.Init(); in Finished Launching!
[Export("collectionView:didSelectItemAtIndexPath:")]
public void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
{
var item = viewModel.Images[indexPath.Row];
var page = new DetailsPage(item, viewModel);
var controller = page.CreateViewController();
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<FrameLayout
android:layout_width="fill_parent"