Skip to content

Instantly share code, notes, and snippets.

🛠
Code.Build.Test.Deploy.Monitor.Repeat(); 🥇

dylanberry dylanberry

🛠
Code.Build.Test.Deploy.Monitor.Repeat(); 🥇
Block or report user

Report or block dylanberry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MsalAadB2CAuthenticationService.cs
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()
View Main.razor
<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=""
View MainPage.xaml
<?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}">
View OneSignal_HandleNotificationOpened.cs
protected override async void OnInitialized()
{
try
{
InitializeComponent();
OneSignal.Current
.StartInit(Secrets.OneSignal)
.HandleNotificationOpened(OnNotificationOpened)
.EndInit();
View OpenUrlExtension.cs
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))]
View NullableDatePicker.cs
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
View MainPage.xaml.cs
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
View VersionCheckHandler.cs
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
View ClientVersionNotSupportedException.cs
using System;
using System.Runtime.Serialization;
namespace VersionCheck.Common
{
[Serializable]
public class ClientVersionNotSupportedException : Exception, ISerializable
{
public string MinimumSupportedClientVersionString { get; }
public string ApiVersionString { get; }
View MinimumClientVersionFilter.cs
using Microsoft.AspNetCore.Mvc.Filters;
namespace VersionCheck.API.VersionCheck
{
public class MinimumClientVersionFilter : IActionFilter
{
private readonly IVersionCheckService _versionCheckHelper;
public MinimumClientVersionFilter(IVersionCheckService versionCheckHelper)
{
You can’t perform that action at this time.