Skip to content

Instantly share code, notes, and snippets.

<CheckBox x:Class="WpfApp1.ImageCheckBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfApp1"
Name="RootCheckBox"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<CheckBox.Template>
public static class NavHelper
{
public static Page CurrentPage => Application.Current.MainPage;
private static INavigation Navigation => CurrentPage.Navigation;
public static async Task PopAsync()
{
var masterDetailPage = CurrentPage as MasterDetailPage;
@julesx
julesx / AndroidDocumentViewer.cs
Last active October 4, 2018 07:43
Xamarin Forms file opener
using Android.Content;
using Mobile.Core.Droid.NativeImplementations;
using Mobile.Core.Interfaces;
using Xamarin.Forms;
[assembly: Xamarin.Forms.Dependency(typeof(DocumentViewer))]
namespace Mobile.Core.Droid.NativeImplementations
{
public class DocumentViewer : IDocumentViewer
{
@julesx
julesx / MainWindow.xaml
Created August 11, 2017 18:13
MouseEnterTest
<Window x:Class="WpfApplication16.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication16"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class LoginPage : ContentPage
{
public LoginPage()
{
InitializeComponent();
NavigationPage.SetHasNavigationBar(this, false);
BindingContext = Activator.CreateInstance(Globals.LoginPageViewModel);
// For users without passwords
public class BaseRegisterVm
{
public Constants.AuthenticationType UserType { get; set; }
public BaseRegisterVm()
{
UserType = Constants.AuthenticationType.Windows;
}
@julesx
julesx / frametest.xaml
Created June 2, 2017 15:16
Frame differences between iOS and Android
<StackLayout Orientation="Vertical" Margin="0,10,0,0">
<Label Text="FUNCTIONS" FontSize="Micro" FontAttributes="Bold" HorizontalOptions="Center" Margin="0,0,0,2" />
<Frame Margin="10,0,10,10" Padding="20,5">
<ListView ItemsSource="{Binding MenuItems}" Footer="{Binding}" HasUnevenRows="True">
<ListView.Behaviors>
<behavior:ListBoxDeselectSelectedItemBehavior />
[assembly: Xamarin.Forms.ExportRenderer(typeof(LandscapePage), typeof(LandscapePageRenderer))]
namespace Mobile.Core.Droid.Renderers
{
public class LandscapePageRenderer : PageRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
{
base.OnElementChanged(e);
((FormsAppCompatActivity)Context).RequestedOrientation = ScreenOrientation.Landscape;
using Android.App;
using Android.Content.PM;
using Android.OS;
using HockeyApp.Android;
using FFImageLoading.Forms.Droid;
using HockeyApp.Android.Utils;
using Plugin.Media;
using Plugin.Permissions;
namespace Merrit.Droid
public class RepeaterView : StackLayout
{
public static readonly BindableProperty ItemTemplateProperty =
BindableProperty.Create("ItemTemplate", typeof(DataTemplate), typeof(RepeaterView));
public static readonly BindableProperty ItemsSourceProperty =
BindableProperty.Create("ItemsSource", typeof(IEnumerable), typeof(RepeaterView), Enumerable.Empty<object>(), BindingMode.OneWay, null, ItemsChanged);
public IEnumerable ItemsSource
{