Lester's WPF\SL Blog

Simple, Easy & Beautiful

Vista gadgets using WPF

Vista gadgets using WPF

Rate This
  • Comments 6

In vista, the sidebar provides valuable real estate and it would be nice to have some WPF stuff in there... You can use IFrame to host the xaml/xbap file as below

<html>

<head>

              <style>

                            body {

                                          width:130;

                                          height:130;

                                          padding:5;

                                          margin:0;

                                          background:black;

                            }

              </style>

</head>

<body>

        <iframe height="130"

                width="130"

                src="3dEarth.xaml" />

</body>

</html>

Thats it...create a folder in username\AppData\Local\Microsoft\Windows Sidebar\Gadgets\  and place the HTML files along with the WPF files. and voila!! some WPF candy on your desktop...

Xbaps provide more features as you could include some code... The sample code for the above is attached (xbap is the same as the xaml)....

For further references you could look at some other blog posts [1 , 2]

Attachment: proj.zip
  • Awesome!

    I've always wondered why the Vista gadgets had to be html. It seems so restrictive. Html makes sense as one supported type. But raw WPF would be nice as well without the workaround you've presented. Seems like a major disconnect to be launching this wonderful WPF platform and then force gadgets follow a standard that WPF is aimed at eliminating...  ;)

  • HTML is the simplest way.. you could also use ActiveX as shown on the post http://blogs.msdn.com/karstenj/archive/2006/10/09/activex-wpf-gadget.aspx

  • For me, this is the way to create Gadgets for Vista's Sidebar - I know that in this "Web 2.0" world...

  • Angus, the bulldog has so taken over the house. At least, it's made us more popular with the neighbors.

  • Angus, the bulldog has so taken over the house. At least, it&#39;s made us more popular with the neighbors

  • Angus, the bulldog has so taken over the house. At least, it's made us more popular with the neighbors. Agile/Extreme Programming I always appreciate the care Jeremy Miller takes in articulating his points and his latest is no exception. In stating his

Page 1 of 1 (6 items)