Monday, December 21, 2009

Create gadgets for Vista and Windows 7 using WPF


Gadgets are mini applications with a variety of possible uses. They can connect to web services to deliver business data, weather information, news updates, traffic maps, Internet radio streams, and even slide shows of online photo albums. Gadgets can also integrate with other programs to provide streamlined interaction. In this post, I’ll show you how to create a Gadget using WPF for Vista and Windows 7 sidebar.
My sample gadget shows the respective .NET type for every SQL Server and the Db method accessor for the type. The gadget is created as an xbap application. The post build script installs the gadget when the application is build.
The gadget.xml file included as part of the project contains the details of the gadget
xml version="1.0" encoding="utf-8" ?>
<gadget>
  <name>DbType to .NET mappername>
  <namespace>BlogsPrajeesh.BlogSpot.Gadgetsnamespace>
  <version>1.0.0.0version>
  <hosts>
    <host name="sidebar">
      <base type="HTML" apiVersion="1.0.0" src="Main.htm" />
      <permissions>Fullpermissions>
      <platform minPlatformVersion="1.0" />
    host>
  hosts>
gadget>

The html file contains the link to the .xbap project, which has the xaml files. Leave a comment with your email address and I’ll mail you the source code for the gadget.

24 comments:

Pete said...

Have you considered posting the source as a zip to a public location, or opening up a small codeplex project with it?

Pete

Prajeesh said...

Thanks Pete,
I have created a codeplex project for the gadget.
http://dbtypetodotnet.codeplex.com/

dorla said...

Thank you for this template! web application

Gabriela said...

Interesting...

Anonymous said...

Great article you got here. It would be great to read a bit more concerning this matter. The only thing that blog misses is a few photos of some gadgets.
David Flouee
Cell phone jammers

Zeeshan Majeed Khan said...

HI man this is Zeeshan will u please send me the source code for windows 7 gadget plz?

Arta said...

Hi.. I love the article and im very curious to try something like this... Can you please send me the source code at artaa.shehu@gmail.com... Thanky you

Anonymous said...

Hi.
i love your work can you sen the project for me?
mail : burhan_em@hotmail.com

Anonymous said...

Hi.
i love your work can you sen the project for me?
mail : burhan_em@hotmail.com

Anonymous said...

Hi.
i love your work can you sen the project for me?
mail : burhan_em@hotmail.com

Anonymous said...

Hi.
i love your work can you sen the project for me?
mail : burhan_em@hotmail.com

Anonymous said...

i'd like to get a source code.
sirdna17@inbox.lv

Thenks

tonmoy said...

Hi, this is tonmoy.
thanks for sharing.
Please mail me the source code on: lonsfair@gmail.com

Amr Mohamed said...

please can you send it to me
my mail : eng.amr.mohammed@gmail.com

Amr Mohamed said...

please could you send to me the source code?

eng.amr.mohammed@gmail.com

Vijay said...

Hi, ur article looks quite interesting. can u share the code.
email:vijayzalaki@gmail.com

Thansk

Abdulkadir Ölmez said...

Thanks your code
mail : kadirolmez@gmail.com

Abdulkadir Ölmez said...

thanks for your works

mail : kadirolmez@gmail.com

Abdulkadir Ölmez said...

thanks for your work

mail : kadirolmez@gmail.com

Bala said...

Hi can u send me the architecture design and code. my email is bala_c15@yahoo.co.in

Thanks.

Prajeesh said...

I have the source code uploaded into codeplex.
http://dbtypetodotnet.codeplex.com/releases/view/37577

ZBasheera said...

Hi...
Thanks Nice post...
Can you send me the source code zbasheera@rediffmail.com

Also, I want to create a Gadget which will give me my alerts for new GMail mails... Can suggestion/advice/sample/article regarding this will help me to proceed.

Thanks in advance,
ZBasheera

ZBasheera said...

Hi...
Thanks Nice post...
Can you send me the source code zbasheera@rediffmail.com

Also, I want to create a Gadget which will give me my alerts for new GMail mails... Can suggestion/advice/sample/article regarding this will help me to proceed.

Thanks in advance,
ZBasheera

Prajeesh said...

Hi ZBasheera,
You can download the source code from the location http://dbtypetodotnet.codeplex.com/.

For Gmail Alerts you should use the GMAIL API for .net and create the gadget using that.
http://code.google.com/apis/gdata/client-cs.html