Download Source Code
Task-It Series
This post is part of a series of blog
posts and videos about the Task-It (task management) application that I
have been building with Silverlight 4 and Telerik's RadControls for
Silverlight 4. For a full index of these resources, please go here.
Finally...the code
I've received many questions about when the source code for the Task-It
application will be released. Well, the time has finally come.
I
haven't been able to release this sooner due to the flurry of releases that
have been coming out lately. Silverlight 4, WCF RIA Services, and even
our Q1 Rad Controls. Each time I got the latest bits I ran into issues
(either bugs or visual issues) in the Task-It that needed to be fixed.
Having said that, the app is far from perfect. There are still some
bugs lurking and things that need to be fixed up visually (especially
the RadGridView filtering popup), but the main purpose of this app is
to show the RadControls for Silverlight 4 in the context of a
real-world application, and I don't want to keep delaying the release
of the source code.
Minimum requirements
To run
the app you will need the latest Silverlight bits. Silverlight 4 RTM,
VS2010 and the Silverlight Tools for VS2010. I've also tried to make
things lay out properly at a minimum resolution of 1024x768, but to be
honest I get pretty used to laying them out on my monitor...which runs at
1920x1080. If you run it at 800x600 there are some things that may not
lay out so well.
Custom styling
One thing you'll
notice is that I've created a custom 'look' for the application. You
may not be a fan of user interfaces that involve primarily black
backgrounds, but my plan is to eventually have multiple skins
available. What I have found in the last year of working with
Silverlight app development though is that custom skinning is not for
the faint of heart. It can be extremely time consuming getting things
to look just as you'd like, and just when you have it right, a new
release comes out that blows everything out of the water.
This is a
piece of Silverlight that I think could be made a lot easier, and I
have had some conversations with the Silverlight development team about
this. Hopefully it'll get easier in the future. Oh, and one other
thing, the custom skinning that I did is by no means a 'complete' skin.
I didn't test things like control appearance in the disabled state, I
didn't skin every control in the Telerik suite, etc., etc....so please
don't take this as a new Telerik skin! :-)
As few frameworks as possible
There are a
lot
of Silverlight frameworks out there. One of my goals is to accomplish
what I want to with as few of them as possible. After all, the more
frameworks, the more dlls, the harder it is to manage framework
updates, and the size of the Silverlight app grows and grows with all
of those dlls. Aside from MEF, which is now part of Silverlight 4, the
primary framework that I've leaned on is the
MVVM Light Toolkit.
Please check out some of my other blog posts, as I've blogged about
using it for commands, and will soon be blogging about using it for
publishing and subscribing to events (a.k.a. the Observer pattern).
Not entirely Blend-friendly
I'll
admit that most of my development is done in VisualStudio, so if you
open things in Blend you won't always get the correct appearance (most
strings will not show up). A lot of this has to do with the fact that
the view model classes that are the brains of the app are created
dynamically by the MEF framework. I'm still working on this piece, and
hopefully John Papa's View Model Locator
pattern will be answer. I'm just trying to figure out how to
implement it in the context of an app that includes multiple
Silverlight Applications (the Tasks, Settings, Dashboard and Help
project are each a separate Silverlight App that are dynamically loaded
via MEF).
By the way, I'm not opposed to Blend, I just haven't had much
luck with custom styling in it. For some reason I always seem to get a
little ways into it, get stuck, and have to jump out to VisualStudio to
examine the control template and understand how it is put together. One
of these days hopefully I'll have time to really sit down with the
latest version of Blend and get to the point where I am as comfortable
in it as I am in VisualStudio.
Where are the comments?
One thing you'll find in my code is that there are
very
few comments. I spent several years working for an architect that is
vehemently opposed to comments, so this is a style that I am used to.
In his opinion, the code should be 'self-documenting'. The reason being
that developers often spend a lot of times writing comments, only to
find that they are frequently out of date...in the sense that the code
has evolved but the comments have not. I've bought into this approach,
where methods should contain very few lines, and have a name that
clearly explain what the method is doing. I hope that you'll be able to
read the code and make sense of what is going on.
Incomplete functionality
There
are some pieces that aren't finished yet. One example would be the
Attachments functionality. Another would be the ability to send a
message to Facebook from the Tasks grid view. I put some stuff in as
placeholders and just haven't had a chance to complete them yet. The
app is also not set up for multiple users, it uses one hard-coded user
(in the database's TaskItUser table) named John Doe. I did also
hard-code the data in the Dashboard's Task Overview widget for now. At
one time I was successfully populating this RadChart with data from a
WCF RIA Services method call, but this was before I moved from LINQ to
SQL to the Entity Framework. I'm still battling how to return the
results returned by a stored prodecure (that takes a parameter) with
the Entity Framework, and the documentation (and my Google searches)
haven't provided the answer yet.
Telerik RadControls
Naturally
I made heavy use of the Telerik RadControls in the app. Not just
because I work for Telerik, but because I honestly feel that they are
the best set of 3rd party controls out there, and that they provide
enough functionality above what the Silverlight Toolkit controls have
to offer to make them worth it. I've only been a Telerik employee for a
little over 3 months, and for almost 4 years prior to joining the team
I used RadControls in my applications for the reasons I mentioned
above.
Validation and Internationalization
Currently
there is some support for form validation and internationalization (or
localization, or globalization, or whatever you want to call it) built
into the app. For validation I'm not currently using the SL Toolkit
DataForm. Although it does some nice functionality, there are some
things I don't like about it, so I've implemented a different method of
validation. As far as internationalization, I'm currently obtaining
strings in the UI via binding to properties in my view model classes
that return strings from the .resx files. I'm not sure yet whether I'm
happy with either of these implementations (validation and
internationalization) as there are some negatives to them, so things
may change in the future...but after all, that's what development and
refactoring is all about. Continue searching for ways to make things
work in a cleaner more effective way!
The database
Unlike my previous posts the database lives in the App_Data folder under the .Web project. The web.config connection string is currently set to use .\SQLEXPRESS, so you may need to update that if your database instance name is different.
DLL security issues?
If by any chance you get warnings about security issues with dll's that were downloaded from another machine, go to the Libs directory under the Task-It project (on your file system, not in VisualStudio), right-click each of the 3 dll's in that directory and click the Unblock button in the bottom right section of the dialog.
More blogs to come...
Please
keep an eye on my blog or follow me on Twitter (@rwozniak) as I will
continue blogging about techniques and technologies used in Task-It.
Please let me know if there are any particular topics you would like me
to blog about. Oh, and please let me know what you think of the app and
the code (and if you find bugs...I may or may not be aware of them). I'm always open to suggestions for improvement!