Skip to content

Instantly share code, notes, and snippets.

@tig
Created December 3, 2012 09:06
Show Gist options
  • Save tig/4193759 to your computer and use it in GitHub Desktop.
Save tig/4193759 to your computer and use it in GitHub Desktop.
wp8 pivot prob
<phone:PhoneApplicationPage
x:Class="Premise.View.Cameras"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Landscape"
Orientation="Landscape"
shell:SystemTray.IsVisible="True"
DataContext="{Binding CamerasViewModel, Source={StaticResource Locator}}"
>
<!--LayoutRoot is the root grid where all page content is placed-->
<phone:PhoneApplicationPage.Resources>
<Style x:Key="emptyPivot" TargetType="phone:Pivot">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="phone:Pivot">
<Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}">
<ItemsPresenter x:Name="PivotItemPresenter" Margin="{TemplateBinding Padding}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CamerasItemStyle" TargetType="phone:PivotItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="phone:PivotItem">
<Image Source="{Binding JpgUrl}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</phone:PhoneApplicationPage.Resources>
<Grid x:Name="LayoutRoot" Background="Transparent">
<!--Pivot Control-->
<phone:Pivot Title="Cameras"
ItemsSource="{Binding Cameras}"
Style="{StaticResource emptyPivot}"
ItemContainerStyle="{StaticResource CamerasItemStyle}" Tap="Pivot_Tap">
</phone:Pivot>
<ProgressBar
Visibility="{Binding IsLoading, Converter={StaticResource VisibilityConverter}}"
IsIndeterminate="{Binding IsLoading}"
VerticalAlignment="Center"
Style="{StaticResource PerformanceProgressBar}" />
<TextBlock
Visibility="{Binding IsLoading, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource PhoneTextNormalStyle}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="Refreshing camera images..."
Margin="0,42,0,0"/>
<TextBlock
Style="{StaticResource PhoneTextNormalStyle}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="{Binding ErrorText}"
Margin="0,42,0,0"/>
</Grid>
</phone:PhoneApplicationPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment