Skip to content

Instantly share code, notes, and snippets.

@shiftkey
Created January 8, 2011 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shiftkey/770803 to your computer and use it in GitHub Desktop.
Save shiftkey/770803 to your computer and use it in GitHub Desktop.
Thought - Simpler XAML Markup
# place to put click handlers
@Code Application.Views.MainView
# by default, textblocks use this style and do TextWrapping="Wrap"
@Default TextBlock Style="{DefaultFontStyle}" Wrap
# by default, Button uses this style
@Default Button Style="{DefaultButtonStyle}"
# tab indent represents child items
PhoneApplicationPage
Grid
Pivot
PivotItem Header="details"
ScrollViewer
StackPanel
Button Click="AddToCart"
"Add To Cart"
Image 400 400 Source="{LargeArt}" Margin="10,10,10,0"
TextBlock Text="{Description}" Margin="10,10,10,0"
PivotItem Header="tracks"
ScrollViewer
ItemsControl ItemsSource="{Items}"
ItemsControl.ItemTemplate
Button Click="Listen" Tag="{Number}"
StackPanel Orientation="Horizontal" Margin="0,0,0,17"
Rectangle 50 50 Fill="#FFE5001B" HorizontalAlignment="Left"
StackPanel Width="311"
TextBlock Text="{Title}"
TextBlock Text="{Length}" Style="{PhoneTextSubtleStyle}"
PhoneApplicationPage.ApplicationBar
AplicationBar
ApplicationBarIconButton IconUri="/Images/appbar/rew.png" Text="Rewind" Click="RewindTrack"
ApplicationBarIconButton IconUri="/Images/appbar/play.png" Text="Play" Click="PlayTrack"
ApplicationBarIconButton IconUri="/Images/appbar/ff.png" Text="Fast Forward" Click="NextTrack"
ApplicationBarIconButton IconUri="/Images/appbar/store.png" Text="Cart" Click="ViewCart"
ApplicationBar.MenuItems
ApplicationBarMenuItem Text="Search" Click="MoveToSearch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment