Click here to Skip to main content
15,893,161 members
Articles / Desktop Programming / WPF

MPP Viewer

Rate me:
Please Sign up or sign in to vote.
4.75/5 (13 votes)
15 Jun 2011CPOL3 min read 103.8K   4.1K   41  
MPP Viewer is a simple viewer for Microsoft Project files. I works well with 2000/2003/2007 file formats.
<UserControl x:Class="ProjectViewer.Views.ResourceSheetView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:control="http://schemas.aspitalia.com/Ricciolo/Controls"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>

        <control:TreeListView Name="dgResources" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding Resources}">
            <control:TreeListView.Resources>
                <ContextMenu x:Key="contextMenuTasks">
                    <MenuItem Header="Resource Details" Click="ResourceDetailsMenuItem_Click" />
                    <Separator />
                    <MenuItem Header="Copy To Clipboard" Click="CopyResourceDetailsMenuItem_Click" />
                </ContextMenu>
                <Style TargetType="{x:Type control:TreeListViewItem}">
                </Style>
            </control:TreeListView.Resources>
            <control:TreeListView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Path=Tasks}">
                </HierarchicalDataTemplate>
            </control:TreeListView.ItemTemplate>
            <control:TreeListView.ItemContainerStyle>
                <Style TargetType="{x:Type control:TreeListViewItem}">
                    <Setter Property="ContextMenu" Value="{StaticResource contextMenuTasks}" />
                    <EventSetter Event="PreviewMouseRightButtonDown"
                                             Handler="OnListViewItemPreviewMouseRightButtonDown" />
                </Style>
            </control:TreeListView.ItemContainerStyle>
            <control:TreeListView.Columns>
                <GridViewColumn DisplayMemberBinding="{Binding Path=Name}" Header="Name" Width="200" />
                <GridViewColumn DisplayMemberBinding="{Binding Path=Id}" Header="Id" />
                <GridViewColumn DisplayMemberBinding="{Binding Path=UniqueId}" Header="Unique Id" />
                <GridViewColumn DisplayMemberBinding="{Binding Path=Initials}" Header="Initials" />
                <GridViewColumn DisplayMemberBinding="{Binding Path=Group}" Header="Group" />
                <GridViewColumn DisplayMemberBinding="{Binding Path=ParentTaskId}" Header="Parent Task Id" />
                <GridViewColumn DisplayMemberBinding="{Binding Path=StartDate}" Header="Start Date"  Width="150"/>
                <GridViewColumn DisplayMemberBinding="{Binding Path=FinishDate}" Header="Finish Date"  Width="150"/>
            </control:TreeListView.Columns>
        </control:TreeListView>

    </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
Architect
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions