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);

How do I customize the style of a tooltip that gets shown ONLY on the CheckBoxes in my Window?

Nest the tooltip’s style within the checkbox’s style as follows: <Window.Resources> <Style TargetType=’CheckBox’> <Style.Resources> <Style TargetType=’ToolTip’> <Setter Property=’Background’ Value=’Red’/> </Style> </Style.Resources> <Setter Property=’FontSize’ Value=’14’/> </Style> </Window.Resources> <Grid> <CheckBox ToolTip=’Sample ToolTip!’>Sample CheckBox</CheckBox> </Grid>

How do I bind my tree to a hierarchical list?

Let us say you have a hierarchical list like this: – Division1 | |— Department1 | |— Room1 | |— Room2 |— Department2 | |— Room3 | |— Room4 – Division2 (……) With corresponding types like this: [C#] public class Division { public string Name{…} public DepartmentsCollection Departments{…} } public class Department { public string Name{…} public RoomsCollection Rooms{…} } public class Room { public string Name{….} } You could then bind a collection of Divisions to a tree to achieve the above look and feel by defining a HierarchicalDataTemplate for Division and Department and a DataTemplate for Room types, as follows: [XAML] <HierarchicalDataTemplate DataType='{x:Type src:Division}’ ItemsSource='{Binding Path=Departments}’> <TextBlock Text='{Binding Path=Name}’/> </HierarchicalDataTemplate> <HierarchicalDataTemplate DataType='{x:Type src:Department}’ ItemsSource='{Binding Path=Rooms}’> <TextBlock Text='{Binding Path=Name}’/> </HierarchicalDataTemplate> <DataTemplate DataType='{x:Type src:Room}’> <TextBlock Text='{Binding Path=Name}’/> </DataTemplate> You can then bind the TreeView to a collection of Divisions. [XAML] <!–myDivisonsCollection could be an ObjectDataSource returning the list of Divisions collection –!> <TreeView ItemsSource='{Binding Source={StaticResource myDivisionsCollection}}’></TreeView>

How to get the RichTextBox’s unformatted text?

You can get the unformatted text in the RichTextBox using this approach RichTextBox rtb = richTextBox as RichTextBox; TextRange tr = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);

What are the data sources I can bind the ComboBox’s list to?

The ComboBox, like the other ItemsControl can be bound to any IList, ObservableCollection or ObjectDataProvider (containing a list type data) as explained in this MSDN topic: ItemsControl Content Model Overview If bound to an ObservableCollection, changes happening in the collection will automatically reflect in the ComboBox. You can also bind to XML Data using an XMLDataProvider as explained in this topic: How to: Bind to XML Data Using an XMLDataProvider and XPath Queries Bind the ComboBox to a CollectionViewSource to be able to bind to sorted or grouped views of your list. CollectionViewSource Class You can also bind to a DataTable in an ADO.NET DataSet as follows: How to: Bind to an ADO.NET Data Source