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:

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

    Pete

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

    ReplyDelete
  3. 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

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

    ReplyDelete
  5. 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

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

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

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

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

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

    Thenks

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

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

    ReplyDelete
  13. please could you send to me the source code?

    eng.amr.mohammed@gmail.com

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

    Thansk

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

    Thanks.

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

    ReplyDelete
  17. 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

    ReplyDelete
  18. 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

    ReplyDelete
  19. 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

    ReplyDelete