Skip to content

Instantly share code, notes, and snippets.

View jlucaspains's full-sized avatar

Lucas Pains jlucaspains

View GitHub Profile
@jlucaspains
jlucaspains / MasterDetailNavigationContainer.cs
Last active July 29, 2018 23:34
FreshMVVM alternative MasterDetailNavigationContainer with lazy loaded pages and FontAwesome icons
using FreshMvvm;
using lpains.Views;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace lpains.Helpers
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="lpains.Views.MasterView"
Title="Menu">
<ContentPage.Resources>
<Style x:Key="IconFA" TargetType="Label">
<Setter Property="Margin" Value="5,5,5,5"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="WidthRequest" Value="27"/>
using Xamarin.Forms;
using System;
namespace lpains.Helpers
{
public class LazyLoadedPage
{
public string Title { get; set; }
public string Icon { get; set; }
public Page Page { get; set; }
using FreshMvvm;
using lpains.Helpers;
using lpains.ViewModels;
using Xamarin.Forms;
namespace lpains
{
public partial class App : Application
{
#!/bin/bash
echo "setting plist"
echo "setting CFBundleVersion to $(Build.BuildNumber)"
echo "setting CFBundleDisplayName to AppName"
echo "setting CFBundleIdentifier to com.Company.AppName"
export INFO="$BUILD_SOURCESDIRECTORY/Path/To/Info.plist"
/usr/libexec/PlistBuddy -c "set :CFBundleVersion $(Build.BuildNumber)" $INFO
public void DoSomething()
{
// explicit access checking
// HasRead is an extension method for UserPrincipal class
if(User.HasRead("App.ResourceName")
{
// do something if user has read access to App.Resource1
}
}
<system.web>
<authentication mode="Windows" />
</system.web>
using System;
using System.Collections.Generic;
using System.IdentityModel.Services;
using System.IdentityModel.Tokens;
using System.Linq;
using System.Security.Claims;
using System.Web.Helpers;
namespace CustomAuth
{
using System;
using System.IdentityModel.Services;
using System.Security.Claims;
using System.Threading;
using System.Web;
namespace CustomAuth
{
public class CacheCustomAuthenticationHttpModule : IHttpModule
{
<configuration>
...
<system.identityModel>
<identityConfiguration>
<claimsAuthenticationManager type="CustomAuth.CustomAuthenticationManager, CustomAuth" />
</identityConfiguration>
</system.identityModel>
...
<system.webServer>
<modules>