Have you tried out .NET 3.5 SP1... If not, try it now. Its got loads of new features for WPF. In fact rather than a service pack, its more of a new release ..
So whats new.. improved deployment, new controls (supports creation of datagrid), improved performance, DirectX integration, HLSL shaders, and many new features.
For the complete details, take a look at Tims post
Links to the executables:
Visual Studio 2008 Service Pack 1 (Beta)
.NET Framework 3.5 Service Pack 1 (Beta)
Visual Studio 2008 Express Editions SP1 (Beta)
Visual Studio 2008 Team Foundation Server 2008 SP1 (Beta)
If you are creating apps which have mdi's (multiple document interfaces) you should definitely take a look at Karls post on MDI task switching. Its an elegant solution and the post explains it nicely ... and yeah you do have the code ...:) .. Take a look

On the forums I saw this interesting problem where there was a need to round the corners of a stackpanel inside a border with cornerradius set...

The top is what you get and the bottom image is what you want. The simplest thing to do here is to set the padding on the border so that the stackpanel doesnt bleed around the corners.
But when that doesnt meet your requirements you will need to set the clip property on the child in the OnRender function so that you get the correct clipping. The code for the above is attached.(thanks to Ifeanyi)
I got a couple of queries from the readers asking if I could provide a slightly non-trivial sample of using automation. So I created a split button user control which looks something like this


If there are no items then you get a checkable button.
The items are created in a popup and are generated on demand. This makes the automation a bit interesting.
As you can see the control supports 3 patterns –
· Invoke (for the button)
· ExpandCollapse (for the drop down)
· Toggle (for the checkable option) – This is just for demo purposes
You will need to specify this in the GetPattern function which overrides the one in the base AutomationPeer.
The other function that you might want to override is GetChildrenCore in case of popups. The default behavior is to go through the visual tree and get the children. However, popups are in a separate visual tree. The sample overrides the function since the items are displayed as part of a popup J
Also for each of the patterns, it is necessary that we implement the provided interfaces. Got this nice little chart from the following link
|
Control Pattern |
Client-Side Class |
Provider-Side Interfaces |
|
Dock |
DockPattern |
IDockProvider |
|
ExpandCollapse |
ExpandCollapsePattern |
IExpandCollapseProvider |
|
Grid |
GridPattern |
IGridProvider |
|
GridItem |
GridItemPattern |
IGridItemProvider |
|
Invoke |
InvokePattern |
IInvokeProvider |
|
MultipleView |
MultipleViewPattern |
IMultipleViewProvider |
|
RangeValue |
RangeValuePattern |
IRangeValueProvider |
|
Scroll |
ScrollPattern |
IScrollProvider |
|
ScrollItem |
ScrollItemPattern |
IScrollItemProvider |
|
Selection |
SelectionPattern |
ISelectionProvider |
|
SelectionItem |
SelectionItemPattern |
ISelectionItemProvider |
|
Table |
TablePattern |
ITableProvider |
|
TableItem |
TableItemPattern |
ITableItemProvider |
|
Text |
TextPattern |
ITextProvider |
|
Toggle |
TogglePattern |
IToggleProvider |
|
Transform |
TransformPattern |
ITransformProvider |
|
Value |
ValuePattern |
IValueProvider |
|
Window |
WindowPattern |
IWindowProvider |
There are other functions that can be overridden if there is a need to customize the return values. As an example you could override the AccesKeyCore function to append a “Alt” string to the return value.
btw to make the automationwork right we need to create the automationPeer in the overridden OnCreateAutomationPeer call in the custom control.
The sample also shows how the automation can be used for testing purposes. A note to be kept in mind is that when accessing the automationelements, we have to be on a separate thread. Most of the times, the testing process will be separate from the product being tested and hence, will be on a separate thread. However, it might be necessary to place in tests in the code itself. Then this note comes in handy.
The control in the sample could be used as a splitbutton or a menu if needed. The toggle behavior is really not necessary but was thrown in to give the behavior some complexity and to show the usage of more patternInterfaces. :).
The sample code is attached
Ivo has posted a nice entry on creating a Media Center PC... One thing nice is that it lists problems with solutions .. ahh!! thats a lifesaver...
Check it out.... It does put an end to the DVR problems of recording the same shows multiple times and what not :) ..

Earlier on I had written an app, BlogPadm which was fulltrust and the writer used Google Data API to write the content to Blogger.com. However, when you create an xbap version of it, a problem arises in that you cannot make WebRequests outside site of origin and hence, the xbap version of the above failed to take off. The workaround is to create a webservice at the site of origin so that the calls are forwarded.
However, the focus of this app was to test cookies. So I hosted a blog server and had the blogwriter at the site of origin. So the flow is something like this:
http://MainSite/Login.aspx à http://blogsite/blogwriter.xbap à http://blogsite/postentry.aspx
The communication between the asp pages and the xbap is through cookies.
Code for this application is attached. Note that this project makes use of servers and hence, the app won’t run on execution since the server code is now on the local machine.
The Blog engine used is the BlogEngine.net which is an open source blog server.
The sample is simplistic but is done so to show how communication through asp/xbaps can be performed using cookies. This was not possible in 3.0
· The main asp page sets a cookie ‘Authenticated’ with a value of 1 or 2.
· The value is analyzed by the xbap and decided the number of features to make available to the user.
· The xbap then sets 2 cookies for the TITLE and DATA of the blog and redirects to the blogserver page
· The blog server page then analyzes the data and posts the data on the server
The code for the Mainsite and blogwriter.xbap is provided. Only the postentry.aspx page of the blog engine was modified and hence only this code has been included. The blogwriter project also includes the projects for the Xaml-Html converter and the editor user control
The code is attached.
The drag drop entry that I had posted has been used by a lot of you guys out there and I have received a lot of suggestions/bugs. I also got a few ready made fixes from you... Thank You :) ... So I finally got down to incorporating all these changes and got the new library up ... One frequent problem was the adorner flickering and this was a result of the adorner being deleted and created ... so thats fixed. There are also some fixes, code moving around and the usual stuff.
Hope you find the new library useful :)
Library attached
This is a pretty nifty tool by Saveen.. The project is on codeplex: http://www.codeplex.com/VisioExportToXAML
The results look amazing: (Visio rendering v/s Xaml render)


Earlier on, I had written a post on maximizing a borderless (WindowStyle=None) window but without covering the taskbar. This solution works well but was not that nice to look at implementation wise :) ... However, theres a simplere solution to achieve the same. I get quite a few queries about the previous post, so I thought it would be a good idea to post this simple solution..
<Window
Width="{DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenWidthKey}}"
Height="{DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenHeightKey}}"
WindowStartupLocation="CenterScreen"
WindowStyle="None"/>
SystemParameters to the rescue... for the code behind version,
win.Height = SystemParameters.MaximizedPrimaryScreenHeight;
win.Width = SystemParameters.MaximizedPrimaryScreenWidth;
win.Top = 0;win.Left = 0;
The WPF team at Microsoft is happy to present the first release of the WPF Application Quality Guide. http://windowsclient.net/wpf/white-papers/wpf-app-quality-guide.aspx It’s a guide that upon completion can be a one-stop shop for guidance and best practices to improve product quality and testability for WPF applications.
For those who missed the news yesterday, Vista SP1 was released to manufacture for the first set of languages (English, French, Spanish, German and Japanese). See the complete post here
The WPF platform is powerful but relatively new. We realize that some things are lacking and we are in listening mode. If you feel that we need to improve or add something, send me a comment. We'll make sure you are heard. :)
A month ago, I was browsing through different blogs and came across Denis Vuyka's blog post on connecting objects on the canvas... Nice post... Being an avid fan of mind maps, that was the natural extension to the library that he created. Check it out

There are 3 types of objects which are basically the same... they contain rich content... Right clicking on the objects opens up an editable Richtextbox... In case you paste in Links, you can click them (Ctrl + Click) ... This opens the link in a new browser window. Maps can be saved/opened. Notice that saving a file also creates a folder with multiple streams. Ideally, everything would be zipped into a single file., I have left this upto you guys :) ... The reason for these multiple streams is the presence of images in Richtextboxes. A simple XamlWriter.Save saves only the image links and not the image. As such, the richtextboxes are saved in the xamlpackage format and picked up on opening the file....
Source code is attached so that you can play around with it... Have fun.. (You need VS 2008 to open the solution file)
To install the app, Click HERE ...
Code: Click Here
Finally, the Reader SDK is out ... From the windowsclient site
"These Syndicated Client Experiences applications exploit the push capabilities of RSS in a model where each application retains full control over the presentation of the content. The Sync Framework and sync service take care of syncing, caching, subscription management and the safe caching of authentication credentials. These services are designed to help publishers focus on what matters to them most: providing differentiated content experiences with very rich content, branding, skinning and custom user interface elements for an optimal end-to-end user experience"
You can now create rich applications like the below very easily... :) ...you can download the msdnreader here

"Included in this SDK:
- Visual Studio and Expression projects
- Sample Generic Reader (complete end to end sample, full source code)
- MSDN Reader (application, feed and full sample source code)
- Reader Quick Start wizard
- Photos: a simple sample demonstrating a syndicated photo experience (full sample source code)
- An integrated branded boostrapper for .Net 3.0 deployment and app installation via Click-Once
- Content Sync Extensions for RSS 2.0 for rich, nested, authenticated feeds
- SCE sync service and desktop UI redistributable components "
To get started, begin with this link http://windowsclient.net/wpf/starter-kits/sce-get-started.aspx
We provide samples, tutorials, hands on labs .... This should help in ramping up really fast.
Also, since this is a beta we would appreciate your feedback... http://windowsclient.net/wpf/starter-kits/sce-feedback.aspx
Happy coding... and do ping me with your completed Syndicated Client Experiences app... :)