How to nest Avalon List items in a document?

List objects are containers for ListItem objects. ListItem objects, in turn, contain blocks, such as paragraphs or lists. So, to nest multiple lists, you can do something like this. <TextFlow xmlns=’′ FontSize=’16pt’> <Paragraph>Top-level text.</Paragraph> <List>  <ListItem>   <Paragraph>Level 1</Paragraph>   <List>    <ListItem>     <Paragraph>Level 2</Paragraph>     <List>      <ListItem>       <Paragraph>Level 3</Paragraph>       <Paragraph>…</Paragraph>      </ListItem>     </List>    </ListItem>   </List>  </ListItem> </List></TextFlow> This posting is provided “AS IS” with…


Custom cursors in Avalon

So, how do you create a custom cursor in Avalon? The most straightforward way is to reference it from a file, but there are also constructor overloads that a Stream argument and an IntPtr argument (in case you have a raw handle). MyWindow.Cursor = new Cursor(@”C:\WINDOWS\Cursors\stopwtch.ani”); What can you do with cursors? Well, a Cursor…


Some notes on Avalon TextBox properties

The Avalon TextBox is an interesting control. Its purpose in life is to edit a string, as opposed to the rich, formatted text editing capabilities of the RichTextBox. One aspect in which the difference can be clearly seen is in the type of objects that are used when programming each control – TextBox will use…


Assonant Announcement About Avalon Adorners Article

Henry has posted a sample on Adorners, showing how to create and use them, and how to leverage the power of Avalon styling to make them look good with a couple of XML lines.  


Finding matches in unsorted collections (or: how to find pairs of socks efficiently)

I was sorting through my clothes after taking them out of the drier today, and I realized that over time I’ve naturally come up with a strategy to optimize my work. The problem is as follows: given an unordered collection of elements (socks), find the pairs matched by a key (sock color / model). The…


Combining marks and interesting effects

I’m planning to blog about some of the challenges involved in creating a world-class text editor, but first I’d like to talk a bit about an interesting set of Unicode characters – combining marks.   These characters, like their name suggest, combine with others and modify their appearance. In this image, you can see my…


How many machines does it take to make a Microsoft employee happy?

It’s late, I’m sorry I can’t of anything more clever to play with ‘how many foo does it take for bar’-types of joke. Anyway, this was about machine setups. Typically we start out with three machines: there’s the “mail” machine, the “dev” machine and a “test” machine. The “mail” machine is the slow, stable one…


Table border and Avalon resources

So, do you want your table cell borders to be visible? Try the new and improved Resources, now available on all participating elements! Note that you can scope this at different levels – anywhere where Resources are available. <Window x:Class=”VancouverApp.Window1″ xmlns=”″ xmlns:x=”″ Text=”My Other Vancouver App” ><Window.Resources> <Style TargetType='{x:Type TableCell}’>  <Setter Property=’Background’ Value=’VerticalGradient SkyBlue LightBlue’ />  <Setter Property=’BorderBrush’ Value=’DarkBlue’ />  <Setter Property=’BorderThickness’…


Just some fun with Avalon

Did you know that the text editor in Avalon is currently implemented on the commanding architecture? Most of the keyboard stuff goes through commands – inserting text is a very interesting topic I’ll save for another post. Commands are typically exposed as entries on some class or another. In this case, we have commands on…


Hibernate is your friend

Last week I drove up to Vancouver to get a new visa. Lovely city. I staid in the downtown area, and was able to walk everywhere – which is a good thing, because finding a place to park is hard (although not impossible). There was a bit of waiting involved, and I made good use…