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
public class FacebookItem | |
{ | |
public string id { get; set; } | |
public string message { get; set; } | |
public string picture { get; set; } | |
public string link { get; set; } | |
public DateTime created_time { get; set; } | |
public DateTime updated_time { get; set; } | |
public int likesCount { get; set; } | |
public int commentsCount { get; set; } |
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
private void ButtonGo_Click(object sender, RoutedEventArgs e) { | |
string facebookname = TextBox_FBName.Text; | |
// Reset textblocks, image, and listbox | |
Image_Cover.Source = null; | |
TextBlock_Desc.Text = ""; | |
TextBlock_Name.Text = ""; | |
ListBox_Photos.Items.Clear(); | |
// Initializes new Facebook Client |
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
public class InstagramItem | |
{ | |
public struct InstagramUser { | |
public string username { get; set; } | |
public string website { get; set; } | |
public string bio { get; set; } | |
public string profile_picture { get; set; } | |
public string full_name { get; set; } | |
public string id { get; set; } | |
} |
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
// Application Identity for Esaan Hackathon | |
private const string appid = "87d4d37f54fe4553873407e4c087b513"; | |
private const string appsecret = "a212d013f20b42afbc136d3a40a4ece4"; |
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
private void GetFeedAsync() { | |
string url = string.Format( | |
@"https://api.instagram.com/v1/media/popular?client_id={0}", | |
appid); | |
Uri endpointUri = new Uri(url); | |
WebClient webclient = new WebClient(); | |
webclient.DownloadStringCompleted += | |
new DownloadStringCompletedEventHandler(webclient_DownloadStringCompleted); |
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
private void DisplayFeed(JToken data) | |
{ | |
List<InstagramItem> items = new List<InstagramItem>(); | |
foreach (JToken token in data) | |
{ | |
InstagramItem item = new InstagramItem(); | |
item.id = token["id"].Value<string>(); | |
item.commentsCount = token["comments"]["count"].Value<int>(); | |
item.likesCount = token["likes"]["count"].Value<int>(); |
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
private void ListBox_Feed_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) | |
{ | |
ListBox listbox = sender as ListBox; | |
App currentApp = App.Current as App; | |
currentApp.CurrentInstagramItem = listbox.SelectedItem as InstagramItem; | |
NavigationService.Navigate( | |
new Uri("/InstagramItemPage.xaml", UriKind.Relative)); | |
} |
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
public InstagramItemPage() | |
{ | |
InitializeComponent(); | |
this.Loaded += new RoutedEventHandler(InstagramItemPage_Loaded); | |
} | |
private void InstagramItemPage_Loaded(object sender, RoutedEventArgs e) | |
{ | |
App currentApp = App.Current as App; | |
this.DataContext = currentApp.CurrentInstagramItem; |
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
<!--LayoutRoot is the root grid where all page content is placed--> | |
<Grid x:Name="LayoutRoot" Background="Transparent"> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto"/> | |
<RowDefinition Height="*"/> | |
</Grid.RowDefinitions> | |
<!--TitlePanel contains the name of the application and page title--> | |
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> | |
<TextBlock x:Name="ApplicationTitle" |
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
private void ShareStatus_Click(object sender, System.Windows.RoutedEventArgs e) | |
{ | |
ShareStatusTask task = new ShareStatusTask(); | |
task.Status = TextBox_Status.Text; // get status text from TextBox_Status | |
task.Show(); | |
} | |
private void ShareLink_Click(object sender, System.Windows.RoutedEventArgs e) | |
{ | |
ShareLinkTask task = new ShareLinkTask(); |