or
<Window.Resources> <CollectionViewSource x:Key="orderViewSource" /></Window.Resources><Grid> <ItemsControl x:Name="rptOrders" ItemsSource="{Binding Source={StaticResource orderViewSource}}"> <ItemsControl.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="160px" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Label Content="{Binding Path=Name}" Grid.Column="0" VerticalAlignment="Center"></Label> <telerik:RadComboBox x:Name="rcbOrder" Grid.Column="1" SelectedItem="{Binding Path=Order}"> <telerik:RadComboBoxItem Content="Extra Hot" /> <telerik:RadComboBoxItem Content="Hot" /> <telerik:RadComboBoxItem Content="Mild" /> </telerik:RadComboBox> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl></Grid>((CollectionViewSource)(FindResource("orderViewSource"))).Source = Data.StaffOrders;public class Data{ public static ObservableCollection<StaffMember> StaffOrders { get { return //loaddata; } } public class StaffMember { public Int32 StaffID { get; set; } public String Name { get; set; } public String Email { get; set; } public String Order { get; set; } }}<Window x:Class="RadControlsWpfApp1.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <Style TargetType="ListBox" x:Key="TelerikListBoxStyle" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Office_BlueTheme, ElementType=ListBox}}"/> </Window.Resources> <StackPanel Orientation="Vertical"> <ListBox Style="{StaticResource TelerikListBoxStyle}" x:Name="telerikStyledListBox" HorizontalContentAlignment="Stretch"> <ListBox.ItemTemplate> <DataTemplate> <Label Content="telerik style" BorderThickness="1" BorderBrush="Black"/> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <ListBox x:Name="listBox" HorizontalContentAlignment="Stretch"> <ListBox.ItemTemplate> <DataTemplate> <Label Content="standard style" BorderThickness="1" BorderBrush="Black"/> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel></Window>
<telerik:RadCalendar Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Grid.RowSpan="2" MinHeight="620" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Columns="4" Rows="3" SelectionMode="Multiple" Name="calMain" IsTodayHighlighted="False" AreWeekNumbersVisible="False" FontFamily="Segoe UI" HeaderVisibility="Hidden" ViewsHeaderVisibility="Visible" IsEnabled="False" Background="White" Foreground="Black" />private void btnEnabled_Click(object sender, RoutedEventArgs e) { calMain.IsEnabled = true; }
I'm wondering about the reason why RadPane and RadDocumentPane fire the IsVisibleChanged and Unloaded events when I'm just dragging the Pane to an other place on the screen (in my case out of my MainWindow)?
IsVisibleChanged might be plausible, because the Pane becomes invisible for the split of a second, but Unloaded is not plausible, because the the Pane still exists.
So to which event do I have to listen if I want to react on the user clicking on the small cross on the pane to close it, if IsVisibleChanged and Unloaded happen also when the user is only dragging the Pane?