Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

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

, 7 Jul 2011
Part 1 of a series describing the creation of a Silverlight business application using MEF, MVVM Light, and WCF RIA Services.
IssueVisionforSilverlightSetup20110630.zip
IssueVision for Silverlight Setup
IssueVisionSetup.msi
setup.exe
IssueVision_for_Silverlight_setup.zip
IssueVisionSetup.msi
setup.exe
IssueVision_Silverlight20110630.zip
IssueVision.Silverlight
Assemblies
GalaSoft.MvvmLight.Extras.SL4.dll
GalaSoft.MvvmLight.SL4.dll
MenuControls.dll
System.Windows.Controls.DataVisualization.Toolkit.dll
System.Windows.Controls.Toolkit.dll
System.Windows.Controls.Toolkit.Internals.dll
System.Windows.Interactivity.dll
Database
IssueVision.Client
IssueVision.Client.csproj.user
Assets
Signin.png
Controls
Properties
Views
IssueVision.Common
IssueVision.Common.csproj.user
Controls
Helpers
Models
Properties
Resources
Themes
IssueVision.Data
IssueVision.Data.csproj.user
Properties
Web
Resources
IssueVision.Data.Web
IssueVision.edmx
Helpers
MetadataClasses
Properties
Resources
Services
IssueVision.Model
IssueVision.Model.csproj.user
Properties
IssueVision.Setup
IssueVisionSetup.vdproj
IssueVision.ViewModel
IssueVision.ViewModel.csproj.user
Properties
IssueVision.Web
IssueVision.Web.csproj.user
Properties
IssueVision_Silverlight_20110316.zip
GalaSoft.MvvmLight.Extras.SL4.dll
GalaSoft.MvvmLight.SL4.dll
MenuControls.dll
System.Windows.Controls.DataVisualization.Toolkit.dll
System.Windows.Controls.Toolkit.dll
System.Windows.Controls.Toolkit.Internals.dll
System.Windows.Interactivity.dll
IssueVision.Client.csproj.user
Signin.png
DataSources
IssueVision.Data.Web.IssueVisionContext.datasource
IssueVision.Data.Web.PasswordResetContext.datasource
IssueVision.Common.csproj.user
IssueVision.Data.csproj.user
IssueVision.edmx
DataTypes
IssueVision.Model.csproj.user
IssueVisionSetup.vdproj
IssueVision.ViewModel.csproj.user
IssueVision.Web.csproj.user
IssueVision_Silverlight_20110606.zip
GalaSoft.MvvmLight.Extras.SL4.dll
GalaSoft.MvvmLight.SL4.dll
MenuControls.dll
System.Windows.Controls.DataVisualization.Toolkit.dll
System.Windows.Controls.Toolkit.dll
System.Windows.Controls.Toolkit.Internals.dll
System.Windows.Interactivity.dll
IssueVision.Client.csproj.user
Signin.png
IssueVision.Common.csproj.user
IssueVision.Data.csproj.user
IssueVision.edmx
IssueVision.Model.csproj.user
IssueVisionSetup.vdproj
IssueVision.ViewModel.csproj.user
IssueVision.Web.csproj.user
IssueVision_Silverlight_Setup.zip
IssueVisionSetup.msi
setup.exe
��USE [IssueVision]

GO

/****** Object:  Table [dbo].[Issues]    Script Date: 04/13/2010 15:53:22 ******/

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (1, N'Occasional crashes when themes are used and pages are changed rapidly', 1, 4, N'user1', 6, 2, 2, N'admin1', GETDATE()-10, GETDATE()-10, N'user1', 0, NULL, 0, NULL, N'Sometimes the Issue Tracker application crashes when themes are used and pages are changed rapidly.  The cause of this is unclear.', N'1. Change the theme to something other than the default.

2. Click links at the top until the application crashes.', NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (2, N'The "all issues" page does not allow issues to be edited.', 0, NULL, NULL, 6, 1, 1, N'admin1', GETDATE()-12, GETDATE()-12, N'user1', 0, NULL, NULL, NULL, N'The "all issues" page is really struggling.  Even if you added a list of issues to the page, you still wouldn''t be able to edit them.  This seems like a major piece of missing functionality.  Users should be able to go to the "all issues" page and edit and save issues.



Visual Studio 2010 can give you a great first step to building this piece of the application quickly.  Consider using the Data Sources window to add a details view of an issue.



For a more polished user experience, consider using the IssueEditor UserControl already in the IssueEditor project.  This should get you well on your way.', N'1. Go to the "all issues" page

2. Observe that there''s no way to edit bugs even though there''s a Save and Cancel button on the page.', NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (3, N'IssueEditor''s right-hand side seems to be broken', 1, 7, N'user1', 6, 1, 1, N'admin1', GETDATE()-40, GETDATE()-40, N'user1', 2, NULL, NULL, NULL, N'The right-hand side of the issue editor seems to be completely broken.  It looks like most of the UI is there, but all of the textboxes are empty and the combo boxes have no items.  How did a break this major go unnoticed?



In addition, the "Platform" datagrid really ought to be grouping by processor type.  Without this grouping, it''s very hard to tell what we''re looking at (and it seems like a reasonable grouping for platforms).



P.S.  Isn''t it ironic that there are so many issues with this issue tracker?  I wonder whose fault that is?', N'1. Go to any page with an issue editor

2. Try to change the "Opened By" or "Resolution" values



Expected: all of the data appears and works properly.

Actual: Half of the editor appears to be broken.', NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (4, N'Can''t save changes on the "all issues" page', 0, NULL, NULL, 0, 1, 1, N'admin1', GETDATE()-60, GETDATE()-60, N'user1', 0, NULL, NULL, NULL, N'Thankfully the issues around adding UI to the "all issues" page are fairly straightforward to address.  Unfortunately, a major piece of functionality is not yet hooked up correctly.  Clicking the "Save" button doesn''t seem to do anything on that page.  This undermines the purpose of the page altogether when it comes to editing items.



Who''s your manager again, David?', N'1. Click on the "all issues" link

2. Edit an issue

3. Click "Save" at the bottom of the page



Expected: The data is saved

Actual: Nothing happens -- the button appears to have no effect.', NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (5, N'User can easily set priority to be lower than severity', 1, 0, N'user1', 0, 0, 2, N'admin1', GETDATE()-55, GETDATE()-55, N'user1', 0, NULL, 0, NULL, N'Currently, Priority and Severity in the issue editors have no checks on them to ensure that priority is at least as high as severity.  After all, if you have a high-severity bug, you should at least be notified if you''re about to set the priority of that bug lower than its severity.  This may be an indication that you''re prioritizing the bug incorrectly.', NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (6, N'test2', 0, 0, NULL, 0, 2, 2, N'user1', GETDATE()-20, GETDATE()-20, N'user1', NULL, NULL, NULL, NULL, NULL, NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (7, N'User can easily file duplicate issues -- can we add Duplicate issue detection?', 0, 0, NULL, 0, 2, 2, N'admin1', GETDATE()-74, GETDATE()-74, N'user1', 0, NULL, NULL, NULL, N'At present, users can easily file duplicate issues.  We should add some easy heuristic to check for duplicates.  For example, if a user enters a title that can be found in other issues'' titles, they should see a validation error letting them know that they may be about to file a duplicate, and indicating which issues to look at in order to make sure that they don''t do so.', NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (8, N'Duplicate issue detection', 0, NULL, NULL, 0, 2, 2, N'admin1', GETDATE()-45, GETDATE()-45, N'user1', 2, NULL, NULL, NULL, N'At present, users can easily file duplicate issues.  We should add some easy heuristic to check for duplicates.  For example, if a user enters a title that can be found in other issues'' titles, they should see a validation error letting them know that they may be about to file a duplicate, and indicating which issues to look at in order to make sure that they don''t do so.', NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (9, N'Right-click theming', 1, 0, N'user1', 0, 3, 3, N'admin1', GETDATE()-80, GETDATE()-80, N'user1', 0, NULL, 0, NULL, N'The Silverlight Toolkit (http://silverlight.codeplex.com) includes a number of themes, a few of which have already been adapted to use implicit styles for this application.  Unfortunately, the user has no way to access them.  We should add right-click support for theming so that users can in fact access the themes.  It''s time to show off!', NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (10, N'How do I file an issue?', 0, 0, NULL, 0, 2, 2, N'admin1', GETDATE()-62, GETDATE()-62, N'user1', NULL, NULL, NULL, NULL, N'I just don''t get it.  How do I file an issue in this application?  It doesn''t seem that straightforward.  Also, who is this "David Poll" guy that most of the issues seem to be assigned to?  How frustrating!', NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (11, N'Add printing support to the "reports" page', 2, 0, N'user1', 0, 2, 2, N'admin1', GETDATE()-76, GETDATE()-76, N'user1', 0, NULL, 0, NULL, N'Right now the "Print report" button on the "reports" page doesn''t seem to do anything.  This should show a print dialog and then provide some rendering of reports for consumption on paper.  Our users need to be able to take the bug list around with them as well as the trend lines for our bugs.', N'1. Go to the "reports" page

2. Click the "print reports" button



Expected: A print dialog followed by an actual printout (as opposed to a fake one?)

Actual: Nada.  Zip.  Zero.  Zilch.  Nothing.', NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (12, N'Is this application ready for PDC?', 1, 0, N'admin1', 0, 4, 4, N'admin1', GETDATE()-34, GETDATE()-34, N'user1', 0, NULL, 0, NULL, N'This application needs to be prepared in plenty of time for PDC.  If the Issue Tracker isn''t ready by then, how will we ensure that the issues in its database have been fixed in time?', N'I don''t know, but this application seems to have become very "meta"', NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (13, N'Test Issue 2', 0, NULL, NULL, 0, 2, 2, N'admin1', GETDATE()-36, GETDATE()-36, N'user1', NULL, NULL, NULL, NULL, N'Test issue 2', N'Test repro step', NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (14, N'Another Test Issue', 3, 3, N'admin1', 0, 3, 4, N'admin1', GETDATE()-48, GETDATE()-48, N'user1', 0, NULL, 2, NULL, N'another test issue', N'test', NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (15, N'Another Test Issue2', 0, NULL, NULL, 0, 2, 2, N'user1', GETDATE()-47, GETDATE()-47, N'user1', NULL, NULL, NULL, NULL, NULL, NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (16, N'test 3', 0, NULL, NULL, 0, 2, 2, N'admin1', GETDATE()-53, GETDATE()-53, N'user1', NULL, NULL, NULL, NULL, NULL, NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (17, N'Test of message box', 0, 3, NULL, 0, 2, 2, N'user1', GETDATE()-67, GETDATE()-67, N'user1', NULL, NULL, NULL, NULL, NULL, NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (18, N'ISSUE 18', 0, NULL, NULL, 0, 2, 2, N'user1', GETDATE()-77, GETDATE()-77, N'user1', NULL, NULL, NULL, NULL, NULL, NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (19, N'test issue 19', 1, NULL, N'user1', 0, 3, 2, N'admin1', GETDATE()-82, GETDATE()-82, N'user1', NULL, NULL, NULL, NULL, N'test issue 19', NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (20, N'test issue 20', 0, 7, NULL, 0, 2, 2, N'user1', GETDATE()-83, GETDATE()-83, N'user1', 2, NULL, NULL, NULL, NULL, NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (21, N'Test 21', 0, NULL, NULL, 0, 2, 2, N'user1', GETDATE()-71, GETDATE()-71, N'user1', NULL, NULL, NULL, NULL, NULL, NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (22, N'Test 22', 0, NULL, NULL, 0, 2, 2, N'user1', GETDATE()-61, GETDATE()-61, N'user1', NULL, NULL, NULL, NULL, NULL, NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (23, N'Test Issue 1', 1, NULL, N'user1', 0, 2, 2, N'user1', GETDATE()-53, GETDATE()-53, N'user1', NULL, NULL, NULL, NULL, N'test issue 1', NULL, NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (24, N'The "all issues" page is blank!', 1, 1, N'user1', 6, 3, 1, N'admin1', GETDATE()-43, GETDATE()-43, N'user1', 0, NULL, NULL, NULL, N'This is a big problem.  Right now, there''s no way to see a list of items on the "all issues" page.  Isn''t this the fundamental purpose of the page?  How could you miss this while building this application?  This oversight is very damaging to the user experience of the application.



Somebody''s been slacking off, I think...  Perhaps a chat with your manager would be appropriate.', N'1. Run the Issue Tracker application

2. Click "all issues" at the top

3. Observe that the UI is mostly empty



Expected: UI that gives a list of issues as well as a way to edit each issue (i.e. master-details)

Actual: There''s no list on the page to choose which issue to edit', NULL)

INSERT [dbo].[Issues] ([IssueID], [Title], [StatusID], [SubStatusID], [AssignedToID], [IssueTypeID], [Severity], [Priority], [ChangedByID], [LastChange], [OpenedDate], [OpenedByID], [PlatformID], [ResolutionDate], [ResolutionID], [ResolvedByID], [Description], [ReproSteps], [DuplicateID]) VALUES (25, N'New Saturday Issue', 1, NULL, N'user1', 0, 2, 2, N'admin1', GETDATE()-38, GETDATE()-38, N'user1', 0, NULL, NULL, NULL, N'New Saturday issue', NULL, NULL)

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)

Share

About the Author

Weidong Shen
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

| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 7 Jul 2011
Article Copyright 2010 by Weidong Shen
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid