This week has unofficially become “completion list feature” blog post week! :) Make sure you check out our previous two posts, on completion list filtering and transparency.
Let’s continue the fun with some screens of description tips in action. Please note that the screenshots below have been scaled down to fit within the blog.
Description tips in action
|

The completion list showing a description tip for a C# field
|
In the screenshot above, the completion list is displayed and upon the highlighting of an item in the list, a description tip appears. In this case, it’s a description tip for an integer field similar to our our .NET Languages Add-on shows description tips.
|

The completion list showing a description tip for the Object.Equals method
|
Here we show a description tip for the base Object’s Equals method. Note how images and multiple font characteristics can be applied in the description tips to render some very readable content.
Content on-demand
In SyntaxEditor for WinForms, each completion list item could be assigned a description that was used to build the content for the description tip. In our next generation design for the WPF version, we’ve made it so you assign a content provider to each item instead. The content provider is called on-demand to retrieve the content to display.
This means you use less overall memory for completion lists since you don’t need to build descriptions up-front. However we have a number of content provider implementations pre-built so you still can build and assign them up-front if you wish.
In advanced languages though, like our .NET Languages Add-on when later implemented for the WPF version, we’ll want to have a single content provider that we assign to all member items, maybe another for type items, etc. The one for member items would be used for items such as in the screenshots above. It would have access to the core member information being represented by the related item and would look up XML documentation on-demand to construct richly formatted description tips like in the screens.
Multiple types of content providers
There are three built-in content providers that ship with SyntaxEditor for WPF.
The first lets you simply pass back a WPF UIElement that you’d like displayed in the description tip. This allows you to place any WPF content in the description tip.
The second accepts a string and renders the text content as plain text within a TextBlock that is displayed in the description tip.
The third, and this is the “fun” one, is one that also accepts a string of HTML subset markup and transforms the markup to UIElements that render like in the screens above. Font properties can be set over spans and images and hyperlinks are supported.
Extensibility in mind
Since the content provider (and most of the rest of our next generation design) is implemented as interfaces, you can create your own customized content providers to return whatever you need.
As you can see, the model for building this rich UI is very open and extensible, and there’s plenty more to come.