This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the current theme | |
OSAppTheme currentTheme = Application.Current.RequestedTheme; | |
// Set the current theme. | |
Application.Current.UserAppTheme = OSAppTheme.Dark; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ContentPage> | |
<StackLayout Margin="20"> | |
<Label Text="This text is green in light mode, and red in dark mode." | |
TextColor="{AppThemeBinding Light=Green, Dark=Red}" /> | |
<Image Source="{AppThemeBinding Light=lightlogo.png, Dark=darklogo.png}" /> | |
</StackLayout> | |
</ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid touch:TouchEff.PressedBackgroundColor="{StaticResource light_blue}" | |
touch:TouchEff.RegularBackgroundColor="{StaticResource white}" | |
touch:TouchEff.Command="{Binding OpenThemePickerCommand}"> | |
... | |
</Grid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
using MyProject.iOS.Renderers; | |
using UIKit; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.iOS; | |
[assembly: ExportRenderer(typeof(Entry), typeof(NumericKeyboardEntryRenderer))] | |
namespace MyProject.iOS.Renderers | |
{ | |
public class NumericKeyboardEntryRenderer : EntryRenderer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Content; | |
using MyProject.Controls; | |
using MyProject.Droid.Renderers; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.Android; | |
using WebView = Android.Webkit.WebView; | |
[assembly: ExportRenderer(typeof(ExtendedWebView), typeof(ExtendedWebViewRenderer))] | |
namespace MyProject.Droid.Renderers | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<yummy:PancakeView Border="{yummy:BorderMarkup Color=Orange, Thickness=10}"> | |
... | |
</yummy:PancakeView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<yummy:PancakeView> | |
<yummy:PancakeView.Border> | |
<yummy:Border Thickness="10" Color="Orange" /> | |
</yummy:PancakeView.Border> | |
... | |
</yummy:PancakeView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Border | |
{ | |
public int Thickness { get; set; } | |
public Color Color { get; set; } | |
public DashPattern DashPattern { get; set; } | |
public BorderDrawingStyle DrawingStyle { get; set; } | |
public Point GradientStartPoint { get; set; } | |
public Point GradientEndPoint { get; set; } | |
public GradientStopCollection GradientStops { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:Foodie.Controls" | |
xmlns:pagemodels="clr-namespace:Foodie.PageModels" | |
x:Class="Foodie.Pages.MainPage"> | |
<local:AppFrame x:DataType="{x:Type pagemodels:MainPageModel}" Title="Meals"> | |
<local:AppFrame.Content> | |
<Grid Padding="0,16"> | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class AppFrame : Grid | |
{ | |
public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Content), typeof(string), typeof(AppFrame), default(string)); | |
public string Title | |
{ | |
get { return (string)GetValue(TitleProperty); } | |
set { SetValue(TitleProperty, value); } | |
} |