Skip to content

Instantly share code, notes, and snippets.

@JuanKRuiz
Created October 20, 2012 09:50
Show Gist options
  • Save JuanKRuiz/3922821 to your computer and use it in GitHub Desktop.
Save JuanKRuiz/3922821 to your computer and use it in GitHub Desktop.
Basic UI Style - Tutorial App Lector RSS
<common:LayoutAwarePage
x:Name="pageRoot"
x:Class="RSSJuanK4Blog.View.RssMainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:RSSJuanK4Blog.View"
xmlns:common="using:RSSJuanK4Blog.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:vm="using:RSSJuanK4Blog.ViewModel"
>
<Page.Resources>
<x:String x:Key="AppName">Blog Ideas de un Conejo</x:String>
<vm:RssMainViewModel x:Key="ViewModel" x:Name="ViewModel"
FeedUrlString="http://blogs.msdn.com/b/juank/rss.aspx"/>
</Page.Resources>
<Grid Style="{StaticResource LayoutRootStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="500"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="pageTitle"
Grid.Column="1" Grid.Row="0"
Text="{StaticResource AppName}"
Style="{StaticResource Title-Main-Style}"
/>
<Image Style="{StaticResource Logo-Style}" Source="ms-appx:///Assets/img/ideas-logo.png"/>
<TextBlock Grid.Column="2" Grid.Row="0" Text="Titulo de prueba"
Style="{StaticResource Title-Post-Style}" />
<WebView x:Name="wvBlogContent"
Grid.Column="2" Grid.Row="1"
Style="{StaticResource WebView-Style}" />
<ListView x:Name="lvwBlogPosts" Grid.ColumnSpan="2" Grid.Row="1"
Style="{StaticResource Lista-Posts-Style}"
ItemTemplate="{StaticResource Post-List-ItemTemplate}" >
</ListView>
</Grid>
</common:LayoutAwarePage>
<Application
x:Class="RSSJuanK4Blog.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:RSSJuanK4Blog">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="Title-Main-Style" TargetType="TextBlock">
<Setter Property="FontSize" Value="45"/>
<Setter Property="FontWeight" Value="Light"/>
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Margin" Value="10" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="Logo-Style" TargetType="Image">
<Setter Property="Margin" Value="10"/>
</Style>
<Style x:Key="Title-Post-Style" TargetType="TextBlock"
BasedOn="{StaticResource Title-Main-Style}" >
<Setter Property="FontSize" Value="30"/>
<Setter Property="TextTrimming" Value="WordEllipsis"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
<Style x:Key="WebView-Style" TargetType="WebView">
<Setter Property="Margin" Value="10,0"/>
<Setter Property="Visibility" Value="Collapsed"/>
<Setter Property="CacheMode" Value="BitmapCache"/>
</Style>
<Style x:Key="Lista-Posts-Style" TargetType="ListView">
<Setter Property="Margin" Value="10,0"/>
</Style>
<Style x:Key="Image-Post-List" TargetType="Image">
<Setter Property="Margin" Value="5"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="120"/>
</Style>
<Style x:Key="Title-PostList-Style" TargetType="TextBlock">
<Setter Property="Width" Value="350"/>
<Setter Property="Height" Value="Auto"/>
<Setter Property="Margin" Value="0,5,5,10"/>
<Setter Property="FontSize" Value="24"/>
<Setter Property="TextTrimming" Value="WordEllipsis"/>
</Style>
<Style x:Key="Summary-PostList-Style" TargetType="TextBlock"
BasedOn="{StaticResource Title-PostList-Style}">
<Setter Property="FontSize" Value="14"/>
</Style>
<DataTemplate x:Key="Post-List-ItemTemplate">
<StackPanel Orientation="Horizontal">
<Image Style="{StaticResource Image-Post-List}"
Source="ms-appx:///Assets/img/Picture.png"/>
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="Titulo de Prueba en multiples lineas"
Style="{StaticResource Title-PostList-Style}"/>
<TextBlock TextWrapping="Wrap"
Text="Titulo de Prueba en multiples lineas., Titulo de Prueba en multiples lineas"
Style="{StaticResource Summary-PostList-Style}"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ResourceDictionary>
</Application.Resources>
</Application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment