Why is the ListBox displaying the type name of the objects in the list instead of the value of a property in the object

By default when you bind the ListBox’s ItemsSource to a collection of objects of a custom type, the ListBox would simply call the object’s ToString() method to determine what to display for each item. The ToString method would normally simply display the type name of the object. If you instead want a value of a property of the object to be displayed in the listbox, you should set the DisplayMemberPath property of the ListBox to that property name as follows: <ListBox ItemsSource='{StaticResource myCollection}' DisplayMemberPath='FirstName' />

I have a custom type called Group which has 2 collections Products and Services and I want both these collections to appear as siblings when the Groups collection is bound to a tree, how do I do that?

Let us say you want have a hierarchical list like this: - Group | |--- Products | |--- Product1 | |--- Product2 |--- Service | |--- Service1 | |--- Service2 And the underlying Group type defined like this: public class Group { public string Name{...} public ProductCollection Products{...} public ServiceCollection Services{...} } Then you will have trouble binding this to a TreeView to get the above indicated effect. To achieve the above effect, you should first implement a dummy ‘Children’ collection that is a combination of the Products and Services collection as follows: public class Group { public string Name{...} public ProductCollection Products{...} public ServiceCollection Services{...} public IList Children{/*Combine Products and Services and return the list here. This could be just a read-only list.*/} } Then create a HierarchicalDataTemplate for the Group object as follows: [XAML] <HierarchicalDataTemplate DataType='{x:Type src:Group}' ItemsSource='{Binding Path=Children}'> <TextBlock Text='{Binding Path=Name}'/> </HierarchicalDataTemplate> This will render both the Products and Services list as siblings at the same level. You should also declare HierarchicalDataTemplates for the Product and Service types you might have defined. You would of course, bind the tree to a collection of Group items.

How do I dynamically hide and unhide tabs in a TabControl ?

The TabItems have a Visibility property which can be set to Collapsed (no space will be reserved for this tab) or Hidden (not rendered, but space will be reserved for this tab). [XAML] <TabControl x:Name='tabControl1'> <TabItem Header='Tab1'></TabItem> <TabItem Header='Tab2' Visibility='Hidden'></TabItem> <TabItem Header='Tab3' Visibility='Collapsed'></TabItem> <TabItem Header='Tab4'></TabItem> </TabControl>

Can I delay the display of a ToolTip ?

You can set a ‘ToolTipService’ property that causes a brief delay before a ToolTip displays. You set the properties of the ‘ToolTipService’ class by attaching them directly to the element that exposes the tooltip. [XAML] <TextBox HorizontalAlignment='Left' ToolTipService.InitialShowDelay='1500' ToolTip='Useful information goes here.'> ToolTip with delay </TextBox>

How do I embed a Button into a TextBox?

This is very easy to do in XAML, as follows: [XAML] <TextBlock x:Name='myTextBlock' Width='100' Height='40'> <Button>Test</Button> </TextBlock> And you can do something similar in C# as follows: [C#] Button btn = new Button(); btn.Content = 'Test'; this.myTextBlock.Inlines.Add(btn);