Skip to content

Instantly share code, notes, and snippets.

appInsights.setup(config.applicationInsightsKey);
appInsights.start();
// set dimensions so reports can distinquish the origin of the logger.
appInsights.defaultClient.commonProperties = {
customProperty1: config.Id,
customProperty2: config.Name
};
client = new appInsights.TelemetryClient(config.applicationInsightsKey);
client.trackMetric(
{
name: "custom metric:POC app-2609-100",
value: 7.5,
properties: {
testValueA: 1,
testValueB: `Apple`
}
});
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using static MultiTapLVItems.DataFactory;
namespace MultiTapLVItems
{
public partial class MainPage : ContentPage
{
public MainPage()
<?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:MultiTapLVItems"
x:Class="MultiTapLVItems.MainPage">
<ContentPage.Resources>
<ResourceDictionary>
<DataTemplate x:Key="MyCardTemplate">
<ViewCell>
public class DataFactory
{
public List<User> Users = new List<User>()
{
new User{ Id = 1, Name = "Abigail Roberts", Designation = "Sr.Manager", PhoneNumber = "+917000800000", ProfilePicture = "user1.png"},
new User{ Id = 2, Name = "Lance Johnston", Designation = "Jr.Manager", PhoneNumber = "+913467347734", ProfilePicture = "user2.png"},
new User{ Id = 3, Name = "Melinda Walters ", Designation = "Analyst", PhoneNumber = "+1221211211", ProfilePicture = "user3.png"},
new User{ Id = 4, Name = "Xuan Li Chow", Designation = "Trainee", PhoneNumber = "+121256578939", ProfilePicture = "user4.png"},
new User{ Id = 5, Name = "James Lamb", Designation = "Intern", PhoneNumber = "+67122210133", ProfilePicture = "user5.png"},
new User{ Id = 6, Name = "Nikki A. Rubin", Designation = "Intern", PhoneNumber = "+6713420133", ProfilePicture = "user6.png"},
using System;
using System.Reflection;
using System.Windows.Input;
using Xamarin.Forms;
namespace MyNameSpace
{
public class EventToCommandBehavior : BehaviorBase<View>
{
Delegate eventHandler;
using System;
using Xamarin.Forms;
namespace MyNameSpace
{
public class BehaviorBase<T> : Behavior<T> where T : BindableObject
{
public T AssociatedObject { get; private set; }
protected override void OnAttachedTo(T bindable)
#region Fields
private ObservableCollection<object> _Items;
private ObservableCollection<object> _ItemsFiltered;
private ObservableCollection<object> _ItemsUnfiltered;
private string _searchText;
#endregion
#region Properties
public string SearchText
<ContentPage.Content>
<Grid x:Name="_rootGrid">
//SearchBar
<SearchBar IsVisible="{Binding SearchMode}" Placeholder="Search items.." Text="{Binding SearchText}">
<SearchBar.Behaviors>
<behaviors:EventToCommandBehavior EventName="TextChanged" Command="{Binding SearchCommand}"/>
</SearchBar.Behaviors>
</SearchBar>
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using Android.Content;
using Android.Content.Res;
using Android.Graphics;
using Android.Views;
using Android.Widget;