Skip to content

Instantly share code, notes, and snippets.

View dansiegel's full-sized avatar
:octocat:
Slinging Code

Dan Siegel dansiegel

:octocat:
Slinging Code
View GitHub Profile
@dansiegel
dansiegel / YourProject.iOS.csproj
Created February 17, 2022 20:03
Xamarin iOS SDK 15.6.0.3 break
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="iOSSDK.Compat.targets" />
<!-- The rest of the file left out for brevity -->
</Project>
@dansiegel
dansiegel / EnumBindingSourceExtension.cs
Created August 18, 2020 18:59
Binding Enums in Xamarin.Forms
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace AwesomeApp.Xaml
{
[ContentProperty(nameof(Type))]
public class EnumBindingSourceExtension : IMarkupExtension
{
public Type Type { get; set; }
@dansiegel
dansiegel / App.xaml.cs
Created May 30, 2020 20:16
ILocalize Sample
public partial class App : PrismApplication
{
protected override void OnInitialized()
{
var localize = Container.Resolve<ILocalize>();
localize.RegisterManager(CoreAppResources.ResourceManager);
// If you don't want to use the current UI Culture
localize.SetCulture(new CultureInfo("es");
}
foreach (var child in tabbedPage.Children)
{
if (child.GetType() == selectedTabType)
{
tabbedPage.CurrentPage = child;
break;
}
else if(child is NavigationPage navPage &&
(navPage.CurrentPage == selectedTabType || navPage.RootPage == selectedTabType))
{
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
using HeyRed.MarkdownSharp;
using System.Runtime.CompilerServices;
// https://www.nuget.org/packages/Markdown/
namespace AwesomeApp.Controls
{
@dansiegel
dansiegel / ViewA.xaml
Created January 9, 2020 14:56
Adding child Partial View to a Partial View
<?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:AwesomeApp.Views"
x:Name="parent"
x:Class="AwesomeApp.Views.ViewA">
<local:ViewB ParentPage="{x:Reference parent}" />
</ContentPage>
@dansiegel
dansiegel / INavigationServiceExtensions.cs
Created May 30, 2018 19:59
Prism Tabbed Navigation
using System;
using System.Linq;
using System.Threading.Tasks;
using Prism.Common;
using Xamarin.Forms;
namespace Prism.Navigation
{
public static class INavigationServiceExtensions
{
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9F0236FA-9A36-40CB-924F-4CA379E05CE1}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
@dansiegel
dansiegel / Info.plist
Created April 26, 2018 16:47
Tokenized Manifest
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>appcenter-$$APP_SECRET$$</string>
</array>
</dict>
</array>
@dansiegel
dansiegel / _colors.scss
Created April 26, 2018 16:11
Sass for Xamarin Forms.
$primaryColor: #303F9F;