The other day, I finished up a small demo app that I was writing over at www.codeproject.com which covers several of the new Windows7 features such as TaskBars/JumpLists.
The finished article looks like this:




The idea behind this demo app is actually very simple, I wanted to show how to use the Managed Extensibility Framework (MEF) to add in a bunch of Pixel Shaders that were inside a separate assembly. I also use some of the new .NET 4.0 goodies such as Dynamic
and ExpandoObject
.
The demo app also show cases how to use the new System.Windows.Shell namespace
.
In case you are wondering, here is how you would create a JumpList
using the new System.Windows.Shell namespace
.
JumpList jumpList = new JumpList();
JumpList.SetJumpList(Application.Current, jumpList);
JumpTask jumpTask = new JumpTask();
jumpTask.Title = "IE";
jumpTask.CustomCategory =
"Keep Notes";
jumpTask.ApplicationPath =
@"C:\Program Files\Internet Explorer\iexplore.exe";
String systemFolder =
Environment.GetFolderPath(
Environment.SpecialFolder.System);
jumpTask.IconResourcePath =
@"C:\Program Files\Internet Explorer\iexplore.exe";
jumpTask.IconResourceIndex = 0;
jumpTask.Arguments = "pixel shaders";
jumpList.JumpItems.Add(jumpTask);
jumpList.Apply();
And here is how you can create a TaskBar
that can interact with your application code, again using the new System.Windows.Shell namespace
.
<Window x:Class="MefFX.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MefFX" Height="600" Width="800">
<Window.TaskbarItemInfo>
<TaskbarItemInfo
ProgressState="Normal"
Description="Some text"
ThumbnailClipMargin=
"{Binding RelativeSource=
{RelativeSource FindAncestor,
AncestorType={x:Type Window}},
Path=BorderThickness}">
<TaskbarItemInfo.ThumbButtonInfos>
<ThumbButtonInfo
Click="SearchForPixelShadersInside_Click"
DismissWhenClicked="False"
ImageSource="Images/ie.png" />
<ThumbButtonInfo Command="{Binding AboutCommand}"
DismissWhenClicked="False"
ImageSource="Images/about.png" />
</TaskbarItemInfo.ThumbButtonInfos>
</TaskbarItemInfo>
</Window.TaskbarItemInfo>
....
....
....
....
</Window>
This TaskBar
is obviously done in WPF4.0 using XAML but it would be easy enough to do in WinForms using the TaskbarItemInfo class which is in the new System.Windows.Shell namespace
.
Anyway, the full article explains all this and a lot more in a lot more detail, so if you feel inclined to have a read through of that, the full article is available over at this link:
Enjoy!
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)
- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence
Both of these at Sussex University UK.
Award(s)
I am lucky enough to have won a few awards for Zany Crazy code articles over the years
- Microsoft C# MVP 2016
- Codeproject MVP 2016
- Microsoft C# MVP 2015
- Codeproject MVP 2015
- Microsoft C# MVP 2014
- Codeproject MVP 2014
- Microsoft C# MVP 2013
- Codeproject MVP 2013
- Microsoft C# MVP 2012
- Codeproject MVP 2012
- Microsoft C# MVP 2011
- Codeproject MVP 2011
- Microsoft C# MVP 2010
- Codeproject MVP 2010
- Microsoft C# MVP 2009
- Codeproject MVP 2009
- Microsoft C# MVP 2008
- Codeproject MVP 2008
- And numerous codeproject awards which you can see over at my blog