Click here to Skip to main content
15,867,453 members
Articles / Desktop Programming / XAML

A Sample Silverlight 4 Application Using MEF, MVVM, and WCF RIA Services - Part 1

Rate me:
Please Sign up or sign in to vote.
4.84/5 (108 votes)
7 Jul 2011CPOL9 min read 2.1M   30.9K   298  
Part 1 of a series describing the creation of a Silverlight business application using MEF, MVVM Light, and WCF RIA Services.
<UserControl x:Class="IssueVision.Common.ReportPrintout"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:common="clr-namespace:IssueVision.Common;assembly=IssueVision.Common"
    mc:Ignorable="d" d:DesignHeight="471" d:DesignWidth="666">
    <UserControl.Resources>
        <common:IssueBrushConverter x:Key="issueBrushConverter"/>
        <DataTemplate x:Name="issueTemplate">
            <Border BorderBrush="Silver" BorderThickness="2" Background="{Binding Converter={StaticResource issueBrushConverter}}" Padding="4" HorizontalAlignment="Stretch" Margin="0,4">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding IssueID, StringFormat='Issue Id: \{0\} '}" />
                        <TextBlock Text="{Binding Title}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Priority, StringFormat='Pri: \{0\} '}" />
                        <TextBlock Text="{Binding Severity, StringFormat='Sev: \{0\}'}" />
                    </StackPanel>
                    <TextBlock TextWrapping="Wrap" Text="{Binding Description, StringFormat='Description: \{0\}', TargetNullValue='No Description'}" />
                </StackPanel>
            </Border>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White" Margin="15">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="300" x:Name="rowDefinition_Charts" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid x:Name="grid_Charts" Grid.Row="1">
            <Image x:Name="image_Charts" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
        </Grid>
        <TextBlock Grid.Row="2" Text="Issues:" Margin="4" />
        <StackPanel x:Name="stackPanel_Issues" Grid.Row="3" />
        <TextBlock x:Name="textBlock_TitleText"
                   Grid.ColumnSpan="2"
                   FontWeight="Normal" FontFamily="Arial Black"
                   FontSize="20" FontStyle="Normal"
                   Text="Temporary Title Text" />
    </Grid>
</UserControl>

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
Weidong has been an information system professional since 1990. He has a Master's degree in Computer Science, and is currently a MCSD .NET

Comments and Discussions