Skip to content

Instantly share code, notes, and snippets.

@jamesmontemagno
Last active January 23, 2020 12:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmontemagno/43c5ea6e79633dfe477df1975eca65d3 to your computer and use it in GitHub Desktop.
Save jamesmontemagno/43c5ea6e79633dfe477df1975eca65d3 to your computer and use it in GitHub Desktop.
<?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="MyFirstOouiApp.Pages.MyPage">
<ContentPage.Content>
<StackLayout>
<Label Text="Hello World" FontSize="Large"
HorizontalOptions="Center" HorizontalTextAlignment="Center"/>
<Button Text="Click Me!!!" Clicked="Handle_Clicked" HeightRequest="50"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace MyFirstOouiApp.Pages
{
public partial class MyPage : ContentPage
{
public MyPage()
{
InitializeComponent();
}
int count = 0;
void Handle_Clicked(object sender, System.EventArgs e)
{
var button = sender as Button;
if (button == null)
return;
count++;
button.Text = $"You clicked {count} times!";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment