Skip to content

Instantly share code, notes, and snippets.

@kakobotasso
Created May 14, 2019 04:23
Show Gist options
  • Save kakobotasso/7242c72cdcf91fd869fbc3732bcfe640 to your computer and use it in GitHub Desktop.
Save kakobotasso/7242c72cdcf91fd869fbc3732bcfe640 to your computer and use it in GitHub Desktop.
MainPage.xaml.cs completed FireEvents
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace FireEvents
{
[DesignTimeVisible(true)]
public partial class MainPage : ContentPage
{
IEventTracker eventTracker;
public MainPage()
{
InitializeComponent();
eventTracker = DependencyService.Get<IEventTracker>();
}
async void OnButton01Clicked(object sender, System.EventArgs e)
{
eventTracker.SendEvent("Click01");
}
async void OnButton02Clicked(object sender, System.EventArgs e)
{
eventTracker.SendEvent("Click02", "Comment", "Hello Events");
}
async void OnButton03Clicked(object sender, System.EventArgs e)
{
var dictionary = new Dictionary<string, string>
{
{"Name", "John Xamarin"},
{"Phone", "55 555 555 555"},
{"Email", "[email protected]"}
};
eventTracker.SendEvent("Click03", dictionary);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment