Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Accessing user's Facebook From ListView

$
0
0

Hi xamarin forum

This maybe a stupid question but is this possible I have a list of Contacts in my listView then when I want to select for example rob's fb link I just tapped on his FB link then I will be thrown properly to Rob's FB sorry for the bad english anyway here is the code im using

<ListView  x:Name="Contacts" ItemTapped="SelectedNumber">
 <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <StackLayout Orientation="Vertical">
                                <StackLayout Orientation="Horizontal">
                                    <Label Text="{Binding CustomerName}" Margin="30,10,10,0"/>
                                    <Label Text="{Binding Address}" Margin="40,10,20,0"/>
                                    <Label Text="{Binding FB}" Margin="15,10,20,0"/>
                                </StackLayout>
                            </StackLayout>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate> 
</ListView>

and my code behind for this

public partial class Contactpage : ContentPage
{
public List tempdata;
public Contactpage()
{
InitializeComponent ();
BindCustomerRecords();
Contacts.ItemsSource = tempdata;
}

private void BindCustomerRecords()
{
tempdata = new List
{
new User(){CustomerName = "Kyle", Address= "Abc St. 123456uj", Phone="111111", Fb="https://www.facebook.com/superduperkylemusic/"},
new User(){CustomerName = "Rob", Address= "Abc St. 123456uj", Phone="111111", Fb="https://www.facebook.com/thereallilrob/"}
}
}
}


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>