or
<
Window
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
x:Class
=
"MainWindow"
xmlns:Forms32
=
"clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
telerik:RadDropDownButton
Content
=
"Browser"
HorizontalAlignment
=
"Left"
Height
=
"Auto"
IsOpen
=
"False"
Margin
=
"36,21,0,0"
VerticalAlignment
=
"Top"
Width
=
"Auto"
DropDownWidth
=
"800"
DropDownHeight
=
"600"
>
<
telerik:RadDropDownButton.DropDownContent
>
<
WindowsFormsHost
>
<
Forms32:WebBrowser
Url
=
"google.com"
></
Forms32:WebBrowser
>
</
WindowsFormsHost
>
</
telerik:RadDropDownButton.DropDownContent
>
</
telerik:RadDropDownButton
>
<
telerik:RadDropDownButton
Content
=
"Button"
HorizontalAlignment
=
"Left"
Height
=
"Auto"
IsOpen
=
"False"
Margin
=
"129,21,0,0"
VerticalAlignment
=
"Top"
Width
=
"Auto"
>
<
telerik:RadDropDownButton.DropDownContent
>
<
WindowsFormsHost
>
<
Forms32:TextBox
Text
=
"Test Text Box"
></
Forms32:TextBox
>
</
WindowsFormsHost
>
</
telerik:RadDropDownButton.DropDownContent
>
</
telerik:RadDropDownButton
>
</
Grid
>
</
Window
>
<
telerik:RadGridView
>
<
telerik:RadGridView.ControlPanelItems
>
<
telerik:ControlPanelItem
ButtonTooltip
=
"{x:Static res:ColumnChooserTooltip}"
>
<
telerik:ControlPanelItem.Content
>
<
ListBox
ItemsSource
=
"{Binding Columns}"
Style
=
"{StaticResource ColumnChooserListBox}"
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
CheckBox
Content
=
"{Binding Header, Mode=OneWay}"
IsChecked
=
"{Binding IsVisible, Mode=TwoWay}"
Style
=
"{StaticResource ListItemsCheckBox}"
/>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
</
ListBox
>
</
telerik:ControlPanelItem.Content
>
</
telerik:ControlPanelItem
>
</
telerik:RadGridView.ControlPanelItems
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"{x:Static res:Column1Name}"
/>
<
telerik:GridViewDataColumn
Header
=
"{x:Static res:Column2Name}"
/>
<
telerik:GridViewDataColumn
Header
=
"{x:Static res:Column3Name}"
/>
...
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
<
telerik:RadGridView.Resources
>
<
CollectionViewSource
Source
=
"{Binding Columns}"
x:Key
=
"AlphabetizedColumnsSource"
>
<
CollectionViewSource.SortDescriptions
>
<
scm:SortDescription
PropertyName
=
"Header"
/>
</
CollectionViewSource.SortDescriptions
>
</
CollectionViewSource
>
</
telerik:RadGridView.Resources
>
<
telerik:RadGridView.ControlPanelItems
>
<
telerik:ControlPanelItem
ButtonTooltip
=
"{x:Static res:ColumnChooserTooltip}"
>
<
telerik:ControlPanelItem.Content
>
<
ListBox
ItemsSource
=
"{Binding Source={StaticResource AlphabetizedColumnsSource}}"
Style
=
"{StaticResource ColumnChooserListBox}"
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
CheckBox
Content
=
"{Binding Header, Mode=OneWay}"
IsChecked
=
"{Binding IsVisible, Mode=TwoWay}"
Style
=
"{StaticResource ListItemsCheckBox}"
/>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
</
ListBox
>
</
telerik:ControlPanelItem.Content
>
</
telerik:ControlPanelItem
>
</
telerik:RadGridView.ControlPanelItems
>
private
bool
_isBusy;
public
bool
IsBusy
{
get
{
return
_isBusy; }
set
{
if
(_isBusy == value)
return
;
_isBusy = value;
OnPropertyChanged();
}
}
var backgroundWorker =
new
BackgroundWorker();
backgroundWorker.DoWork +=
delegate
{
IsBusy =
true
;
DoHeavyWork();
};
backgroundWorker.RunWorkerCompleted +=
delegate
{
IsBusy =
false
;
};
backgroundWorker.RunWorkerAsync();