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 Xamarin.Forms; | |
namespace Myproject.Views | |
{ | |
public class CustomView : View | |
{ | |
public CustomView() | |
{ | |
} | |
} |
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 Myproject.Interfaces; using Myproject.Pages; using System; using Xamarin.Forms; namespace Myproject { /// <summary> /// The main class that is used to initialze xamarin forms. /// </summary> public partial class App : Application { /// <summary> /// Gets or sets the UserPreferencesStore. /// </summary> public static IUserPreferencesStore UserPreferencesStore { get; private set; } public App(IUserPreferencesStore userPreferencesStore) { InitializeComponent(); //Usually uses an init method, but this allows earlier access. App.UserPreferencesStore = userPreferencesStore; //App.Current.MainPage = new NavigationPage(new MainPage()); } } } |
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
//Without sending arguments | |
//Subscribe | |
MessagingCenter.Subscribe<object> (this, "Arrived", (sender) => { | |
// do something whenever the "Arrived" message is sent from whatever type | |
//<object> is. | |
}); | |
//Send | |
//All subscribers to "Arrived" of type "this" will be notified. |
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
<?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="Myproject.Pages.LoginPage" Padding="25, 20, 25, 10" BackgroundColor="{StaticResource defaultBackgroundColor}" Title="Sign In"> <ContentPage.Content> <StackLayout Padding="10,0,10,20" VerticalOptions="FillAndExpand"> <StackLayout x:Name="contentLayout" VerticalOptions="CenterAndExpand"> <Image Source="PPP_Logo.png"/> <Label Text="Email" TextColor="{StaticResource defaultLabelTextColor}" /> <Entry x:Name="emailEntry" /> <Label Text="Password" TextColor="{StaticResource defaultLabelTextColor}" /> <Entry x:Name="passwordEntry" IsPassword="true"/> <Button Text="Sign In" TextColor="{StaticResource defaultButtonTextColor}" Clicked="OnLoginButtonClicked" BackgroundColor="{StaticResource greenButtonBackgroundColor}"/> |