Thursday, September 22, 2011

Extending the Personalplaner

Every application should be extensible!
That's why I added the ability to create plugins for the Personalplaner. Well actually I did it mainly just for the fun of it...

To achieve this I used MEF. MEF started as a Codeplex project but now is fully integrated in the .NET Framework in the Assembly System.ComponentModel.Composition.

With the help of MEF it is realy easy to create and use plugins resp. export and import objects.
In my case I only had to create an Interface and implement this in the plugin class and add the class attribute [Export(typeof(IPlugin))] (IPlugin is the interface I created...)

[Export(typeof(IPlugin))]
public partial class PlanAnalysisPlugin : BaseControl, IPlugin
{
    ...
}


In the class that imports the plugins, I only needed to create a CompositionContainer that creates/imports the objects and a container that will containe the imported objects.

CompositionContainer _container;

//public IEnumerable<Lazy<IPlugin, IPluginMetadata>> Plugins
/// <summary>
/// Enumeration containing all loaded pluginsEnumeration containing all loaded plugins
/// </summary>
[ImportMany]
public IEnumerable<IPlugin> Plugins
{
    get;
    set;
}

private bool Compose()
{
    if (!Directory.Exists("plugins"))
        return false;

    var catalog = new AggregateCatalog();
    catalog.Catalogs.Add(new DirectoryCatalog("plugins"));

    _container = new CompositionContainer(catalog);

    try
    {
        this._container.ComposeParts(this);
    }
    catch (Exception)
    {
        return false;
    }

    return true;
}

In my case I decided to keep the plugins in the subfolder named plugins.


If the folder is empty then the application should look like this. On the left side there are only the options for Plan and About.


If I put my plugin into the folder plugins, the application should load and insert it in between Plan and About. In this case I created a plugin that shows some reports and displays some additional inforamation to the plans.


I know that I will most probably be the only person that will ever create a plugin or an extension for the Personalplaner. But with this I can easily extend the Personalplaner with new features without having to create a new version and a setup every time.

Monday, September 12, 2011

Animated loading screen

When loading big data collections or switching between views that contain a lot of data, there is often a big timespan where the user is not sure if the application has crashed or if it is doing something.
So I wanted to draw a semi transparent overlaying layer over the window and create an animation that indicates that the application is doing some work.

Sounds easy... In reality it's something that's almost impossible!

In wpf the UI thread is not the same as the main application thread. But still they are linked to each other so that the UI thread gets blocked when the main thread is working hard. With this restriction there can't be any semi transparent layer and especialy no animation that gets shown or executed while the main thread is working.

When I was about to give up I stumbled upon a grea thread by Dwayne Need describing how single elements in wpf can be run in a separate thread. This means some complicated threading and trying to get the data binding and the resizing of the controls syncronized between the different threads, but in the end I managed to get it all worked out.

Now I am able to display an animation while the main tread is doing some hard work trying to accomplish whatever tasks I let it do.



Wednesday, September 7, 2011

Print preview in Personalplaner 2.0

I implemented the new print dialog and the print preview for the Personalplaner.


I was not shure if I should create my own new implementation of a print dialog or use the default dialog, even though it doesn't suit my needs very well.
And how should I create the preview of the printout?

I decided to create my own version of a print dialog and implement the preview both in one...
And I like it!


On the left side the user can choos which teams and which columns of that should be printed and which printer to use.
The user has the possibility to preview all pages with the pageing at the bottom left of the preview image.

 For previewing the printout I developed a pageviewer, with paging ability and the preview completely new and all from scratch. If the window is smaller than the printout/pagesize, the pageviewer automaticaly scales the pages down so that the whole page is allways visible.

 I'm realy pleased with the result I got.

Wednesday, August 31, 2011

New Personalplaner Icon

I'm not too happy with the Icon of the Personalplaner. It doesn't show any meaning that can be associated with the personalplaner and it doesn't realy look good.
So I made some designs for a new Icon for the Personalplaner.
I'm not really a good graphics designer so it took a while for me to think of some ideas and to be able to draw them.

For the drawing I used VecDraw and paint.net. paint.net is great and ideal for me because ist not too big, easy to use and most of all: it's for free.
This was also another good opurtunity for me to use and test VecDraw and see if it is really useable.


I want the Icon to show what the application is about or at least show a meaning that can be associated with it.

This was the first idea I had. It shows a P instead of the G that is contained in the original icon. But in the end this is not really an option because it doesn't look good at all...

1.

I thought something round would be nice but I discarded the idea right when I was finished:

2.

From then on it started getting better. I made a PP instead of of only just one P. In some I tried to add a layout displaying a plan.

I think one of the following will be the new icon.

3.

4.

5.

6.

7.



I will still try out some more things like adding a dropshadow to the letters. But basicaly I think it will be with one of the last designs.
I especialy like nr. 3, 4, 6 and 7. I am considering if it maybe should be a combination of the last 2 depending on the size of the image. You can't read much when the image is only 16x16 px...

Feel free to leave a comment adn tell me which one you favour.



Update:

I added a dropshadow and a little alpha blend to the letters because the red was too bright

4.1

4.2

Tuesday, August 23, 2011

Plan merged to new design

I was able to finish merging the main plan of the Personalplaner to the new platform with the new design. The new Style makes all much smoother to look at and makes it easier to use.



With this done I can eliminate one of my greatest fears for failing in this project.
- I absolutely had no idea how I would create the view and split the data so that it would fit into the grids
- I did not know if I should create a complete new type of grid control or if I should use/extend an existing implementation of a grid
- I didn't know how I wanted to fill the data into the grids
- I was not shure how I could link the different grids with each other and still ensure code abstraction
- I was not shure if I could setup the data correctly to be able to use my MVVM implenmentation correctly

In the end I was able to do it just the way it was supposed to be and it all works eaven better than it used to :-)

Doing it corectly this time, I was able to eliminate about 3/5 of the code I used in the previous version.



Thursday, August 4, 2011

VecDraw 0.5.55.11216

I released a new version of VecDraw.
I fixed some small bugs that caused the application to crash. In this new release I als changed the window style to have its own boarder instead of the glass border by Microsoft.


Changeset:
- Changed the Window style
- Fixed a bug that caused a crash when copy/pasting a single line
- Fixed different minor bugs


As allways VecDraw can be seen over at vecdraw.codeplex.com
And as allways you can download and use VecDraw for free!

Friday, July 15, 2011

VecDraw without Glass border

Today I decided to get rid of the Glass border every window has on Windows7.

I added the Microsoft.Windows.Shell library and had to do some templating and voila! VecDraw has its own border style resp. has no border at all.
The resizing, Drag&Drop and all the buttons at the top right still work the way they should.

While recreating the template I also changed the template for the main menu a little bit and replaced the File menu button with a button called VecDraw.




This will be contained in the next release.

Thursday, July 14, 2011

VecDraw

VecDraw is a small lightweight vector based drawing application that I developed to get to know WPF. It's not as big as some other Vecotor based drawing applications, but hey! I'm the only developer and it's for free...

It can be found on vecdraw.codeplex.com. It's open source and free for installation. So go ahead and install it.



Personalplaner 2.0

The Personalplaner is an old school project that I made.
Unfortunately at that time I was not the developer I am now.
At the moment I am porting my old Personalplaner from WinForms to WPF.
Beside changing the layout and the graphics I am also implementing a MVVM Pattern, and splitting up the layers properly. Besides that I am implementing a proper ServiceLocator Pattern for providing services and the ability for UnitTesting.
Beside redesigning everything I also intend to get some more languages into it (at the moment german is the only option...)

I am still far away from finishing but I'm working on it.

The old Personalplaner can be found at personalplaner.codeplex.com. There is also a somewhat out of date blog that I will update some time soon (hopefuly...) personalplaner.blogspot.com/
The Personalplaner is open source and free for use. So there is no reason why you should not download and install it... :-)
The sources aren't up to date because I use a different repository for my development, but I will update the them when I have a somewhat stable version running.

Here is how the Personalplaner used to look:


Here is how it looks now:




Block Invasion

Block Invasion is my second game for WP7. I intend to create a fast, rapid and new type of Spaceinvaders game.
At the moment it's in absolute development state. I'm still not sure on all the details that will be contained and how the levels will be setup. The artwork is also very sketchy and will need a lot of my time. If someone is good at designing PLEASE contact me ;-)





BattleShips

BattleShips is a Game for WP7 that I am creating at the moment.
It's only a simple game that I mainly created to test and look at game development using xna.
At the moment it's in Beta test stage.