or
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
Controls:RadPanelBar
ScrollViewer.HorizontalScrollBarVisibility
=
"Disabled"
ScrollViewer.VerticalScrollBarVisibility
=
"Disabled"
>
<
Controls:RadPanelBarItem
>
<
Controls:RadTreeView
Grid.Column
=
"0"
HorizontalAlignment
=
"Stretch"
Animation:AnimationManager.IsAnimationEnabled
=
"False"
>
<
Controls:RadTreeViewItem
Header
=
"1"
>
<
Controls:RadTreeViewItem
Header
=
"2"
/>
<
Controls:RadTreeViewItem
Header
=
"2"
/>
<!-- Insert items until the vertical scroll bar can scroll down -->
</
Controls:RadTreeViewItem
>
</
Controls:RadTreeView
>
</
Controls:RadPanelBarItem
>
</
Controls:RadPanelBar
>
<
GridSplitter
Grid.Column
=
"0"
Width
=
"3"
HorizontalAlignment
=
"Right"
/>
<
Button
Grid.Column
=
"1"
>Test</
Button
>
</
Grid
>
Private void Button_Click( object sender, RoutedEventArgs e)
{
PrintDocument document = new PrintDocument ();
document.PrintPage += (s, args) =>
{
args.PageVisual = this.radBookItem1;
};
document.Print("Silverlight Printing Demo");
};
01.
<
telerik:RadRibbonWindow
x:Class
=
"WpfApp.MainWindow"
03.
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
04.
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
05.
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
06.
<
telerik:RadRichTextBoxRibbonUI
>
07.
<
telerik:RadRibbonTab
Header
=
"Tab1"
>
08.
<
telerik:RadRibbonGroup
Header
=
"BBB"
>
09.
<
telerik:RadToggleButton
Name
=
"ToggleButton"
Content
=
"Show"
/>
10.
</
telerik:RadRibbonGroup
>
11.
</
telerik:RadRibbonTab
>
12.
13.
<
telerik:RadRibbonTab
ContextualGroupName
=
"TestTab"
Header
=
"Tab2"
>
14.
<
telerik:RadRibbonGroup
Header
=
"AAA"
>
15.
<
telerik:RadRadioButton
Name
=
"TARGET_BUTTON"
Content
=
"ClickMe"
/>
16.
</
telerik:RadRibbonGroup
>
17.
</
telerik:RadRibbonTab
>
18.
19.
<
telerik:RadRichTextBoxRibbonUI.ContextualGroups
>
20.
<
telerik:RadRibbonContextualGroup
Header
=
"Test"
IsActive
=
"{Binding IsChecked, ElementName=ToggleButton}"
Color
=
"BlueViolet"
GroupName
=
"TestTab"
/>
21.
</
telerik:RadRichTextBoxRibbonUI.ContextualGroups
>
22.
</
telerik:RadRichTextBoxRibbonUI
>
23.
</
telerik:RadRibbonWindow
>
01.
var app = AutomationElement.RootElement.FindFirst(TreeScope.Children,
new
PropertyCondition(AutomationElement.NameProperty,
"My Application"
));
02.
var allChildren = TreeWalker.RawViewWalker.GetParent(app).FindAll(TreeScope.Descendants, Condition.TrueCondition);
03.
04.
foreach
(AutomationElement automationElement
in
allChildren)
05.
{
06.
try
07.
{
08.
if
(automationElement.Current.AutomationId ==
"TARGET_BUTTON"
)
09.
{
10.
Console.WriteLine(
"{0} ({1})"
, automationElement.Current.ClassName, automationElement.Current.AutomationId);
11.
}
12.
}
13.
catch
{ }
14.
}