Skip to content

Instantly share code, notes, and snippets.

View dylanberry's full-sized avatar
🛠️
Code.Build.Test.Deploy.Monitor.Repeat(); 🥇

dylanberry dylanberry

🛠️
Code.Build.Test.Deploy.Monitor.Repeat(); 🥇
View GitHub Profile
public class AuthenticationService
{
public bool IsUserAuthenticated => !string.IsNullOrWhiteSpace(AccessToken);
public string AccessToken { get; private set; }
private readonly IPublicClientApplication _publicClientApplication;
private readonly string[] _scopes;
private readonly JwtSecurityTokenHandler _jwtSecurityTokenHandler = new JwtSecurityTokenHandler();
public AuthenticationService()
<ContentPage>
<StackLayout>
@foreach (var option in Options)
{
<Frame CornerRadius="4" Padding="0">
<StackLayout Orientation="StackOrientation.Horizontal" Padding="5"
BackgroundColor="(option.IsEnabled ? (option.IsSelected ? Color.DarkBlue : Color.White) : Color.DarkGray)"
IsEnabled="option.IsEnabled">
<Button Text="Select" OnClick="(() => OnSelectType(option))" />
<Label Text="✓"
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:XamlFlags"
x:Class="XamlFlags.MainPage"
x:Name="Page">
<ContentPage.BindingContext>
<local:MainPageViewModel />
</ContentPage.BindingContext>
<StackLayout BindableLayout.ItemsSource="{Binding Options}">
protected override async void OnInitialized()
{
try
{
InitializeComponent();
OneSignal.Current
.StartInit(Secrets.OneSignal)
.HandleNotificationOpened(OnNotificationOpened)
.EndInit();
using System;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Essentials;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace XamlOpenUrl.Extensions
{
[ContentProperty(nameof(Url))]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace BSILabs.Controls
{
public class NullableDatePicker : DatePicker
using Microsoft.AspNetCore.Mvc.Filters;
namespace VersionCheck.API.VersionCheck
{
public class MinimumClientVersionFilter : IActionFilter
{
private readonly IVersionCheckService _versionCheckHelper;
public MinimumClientVersionFilter(IVersionCheckService versionCheckHelper)
{
using System;
using System.Runtime.Serialization;
namespace VersionCheck.Common
{
[Serializable]
public class ClientVersionNotSupportedException : Exception, ISerializable
{
public string MinimumSupportedClientVersionString { get; }
public string ApiVersionString { get; }
using System;
using System.ComponentModel;
using System.Net.Http;
using System.Threading.Tasks;
using VersionCheck.Common;
using Xamarin.Forms;
namespace VersionCheck
{
// Learn more about making custom code visible in the Xamarin.Forms previewer
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using VersionCheck.Common;
namespace VersionCheck
{
public class VersionCheckHandler : DelegatingHandler