Click here to Skip to main content
15,896,063 members
Articles / Desktop Programming / WPF

The WPF Podcatcher Series - Part 2 (Structural Skinning)

Rate me:
Please Sign up or sign in to vote.
4.97/5 (58 votes)
5 Mar 2008CPOL16 min read 253.6K   7.2K   166  
The second article in a series devoted to a WPF application that plays streaming audio podcasts off the Internet. This article discusses the idea and implementation of look-less applications.
<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:model="clr-namespace:Podder.Model;assembly=PodderLib"
  xmlns:podder="clr-namespace:Podder"
  xmlns:ui="clr-namespace:Podder.UI"
  xmlns:views="clr-namespace:Podder.DefaultSkin.Views"
  >

  <!-- VIEWS 
  These views are loaded by the Window which displays them.  
  They are located based on their x:Key value, which is used 
  in a dynamic resource reference.
  -->
  <views:MainWindowView x:Key="VIEW_MainWindow" />

  <!-- 
  This view is not shared because a new instance is needed every time the 
  PodcastsDialog is opened.
  -->
  <views:PodcastsControlView x:Key="VIEW_PodcastsControl" x:Shared="False" />

  <!-- BRUSHES -->
  <LinearGradientBrush 
    x:Key="PrimaryViewBackBrush" 
    StartPoint="0,0" EndPoint="1,0.5"
    >
    <GradientStop Color="#110088DD" Offset="0" />
    <GradientStop Color="#2200AADD" Offset="1" />
  </LinearGradientBrush>

  <SolidColorBrush x:Key="GroupBoxBackBrush" Color="#BBFFFFFF" />

  <!-- STYLES -->
  <Style x:Key="BaseWindowStyle" TargetType="{x:Type Window}">
    <Setter Property="FontSize" Value="14" />
  </Style>

  <Style 
    TargetType="{x:Type ui:MainWindow}" 
    BasedOn="{StaticResource BaseWindowStyle}"
    >
    <Setter Property="MinHeight" Value="620" />
    <Setter Property="MinWidth" Value="720" />
  </Style>

  <Style 
    TargetType="{x:Type ui:PodcastsDialog}" 
    BasedOn="{StaticResource BaseWindowStyle}"
    >
    <Setter Property="MinHeight" Value="600" />
    <Setter Property="MinWidth" Value="700" />
  </Style>

  <!-- DATA TEMPLATES-->
  <DataTemplate DataType="{x:Type model:Podcast}">
    <TextBlock>
      <TextBlock Text="{Binding Path=Name}" />
      <TextBlock
        FontWeight="DemiBold" 
        Foreground="DarkRed"
        Text="{podder:ResourceString InvalidFeedDisplayText}"
        >
        <TextBlock.Style>
          <Style TargetType="TextBlock">
            <Setter Property="Visibility" Value="Hidden" />
            <Style.Triggers>
              <DataTrigger Binding="{Binding Path=HasInvalidFeed}" Value="True">
                <Setter Property="Visibility" Value="Visible" />
              </DataTrigger>
            </Style.Triggers>
          </Style>
        </TextBlock.Style>
      </TextBlock>
    </TextBlock>
  </DataTemplate>

</ResourceDictionary>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Josh creates software, for iOS and Windows.

He works at Black Pixel as a Senior Developer.

Read his iOS Programming for .NET Developers[^] book to learn how to write iPhone and iPad apps by leveraging your existing .NET skills.

Use his Master WPF[^] app on your iPhone to sharpen your WPF skills on the go.

Check out his Advanced MVVM[^] book.

Visit his WPF blog[^] or stop by his iOS blog[^].

See his website Josh Smith Digital[^].

Comments and Discussions