Skip to content

Instantly share code, notes, and snippets.

View anuith's full-sized avatar
💭
Hello World

Thiwakorn anuith

💭
Hello World
View GitHub Profile
@anuith
anuith / gist:2981521
Created June 24, 2012 03:59
Windows Phone Hackathon : Bing Map Sample - UI no map
<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,17">
<TextBlock x:Name="ApplicationTitle" Text="MY MAP APPLICATION"
Style="{StaticResource PhoneTextNormalStyle}" FontSize="24"/>
@anuith
anuith / gist:2981547
Created June 24, 2012 04:08
Windows Phone Hackathon : Facebook & Instagram Sample - UI
<!--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" Style="{StaticResource PhoneTextNormalStyle}"><Run Text="MY"/><Run Text=" "/><Run Text="FACEBOOK &amp; INSTAGRAM"/><Run Text=" APPLICATION"/></TextBlock>
@anuith
anuith / gist:2981550
Created June 24, 2012 04:10
Windows Phone Hackathon : Facebook & Instagram Sample - Facebook UI
<!--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,15"
Background="#3B5998">
@anuith
anuith / gist:2981553
Created June 24, 2012 04:10
Windows Phone Hackathon : Facebook & Instagram Sample - Facebook ItemTemplate UI
<DataTemplate x:Key="FeedItemTemplate">
<Grid Background="#7F3B5998" Margin="0,0,0,30">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
@anuith
anuith / gist:2981695
Created June 24, 2012 04:51
Windows Phone Hackathon : Facebook & Instagram Sample - InstagramItem UI
<!--LayoutRoot is the root grid where all page content is placed-->
<ScrollViewer x:Name="LayoutRoot">
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
@anuith
anuith / gist:2981700
Created June 24, 2012 04:52
Windows Phone Hackathon : Facebook & Instagram Sample - Instagram Page UI
<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Key="InstagramItemTemplate">
<Grid Margin="6">
<Image Source="{Binding image}" Width="102"/>
</Grid>
</DataTemplate>
<ItemsPanelTemplate x:Key="InstagramListItemsPanel">
<toolkit:WrapPanel/>
</ItemsPanelTemplate>
</phone:PhoneApplicationPage.Resources>
@anuith
anuith / gist:2984654
Created June 24, 2012 19:46
Windows Phone Hackathon : Facebook & Instagram Sample - Main Page Code
private void FacebookButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/FacebookSample.xaml", UriKind.Relative));
}
private void InstagramButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/InstagramSample.xaml", UriKind.Relative));
}
@anuith
anuith / gist:2984664
Created June 24, 2012 19:50
Windows Phone Hackathon : Facebook & Instagram Sample - Facebook Page Variables
// Application Identity for Esaan Hackathon
private const string appid = "397447343624838";
private const string appsecret = "85d6484f38bb656672924c9be9e33377";
private string accessToken;
@anuith
anuith / gist:2984671
Created June 24, 2012 19:53
Windows Phone Hackathon : Facebook & Instagram Sample - Facebook Page Code - Get Access Token
public FacebookSample()
{
InitializeComponent();
// Get Access Token
GetAccessTokenAsync();
}
private void GetAccessTokenAsync()
{
string url = string.Format(
@anuith
anuith / gist:2984675
Created June 24, 2012 19:56
Windows Phone Hackathon : Facebook & Instagram Sample - Facebook Page Code - Get Page Info
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