Class MainWindow Public Sub New() ' This call is required by the designer. InitializeComponent() ' Add any initialization after the InitializeComponent() call. RadPropertyGrid1.Item = New Employee End SubEnd ClassClass Employee Public Property Name As String Public Property Position As PositionType <Flags()> _ Public Enum PositionType As Integer All = -1 None = 0 Engineer = 1 Sales = 2 Marketing = 4 Management = 8 End EnumEnd Class| <telerikNavigation:RadTileView ItemsSource="{Binding Items}"> |
| <telerikNavigation:RadTileView.ItemTemplate> |
| <DataTemplate> |
| <TextBlock Text="{Binding Name}" Style="{StaticResource HeaderTitle}"/> |
| </DataTemplate> |
| </telerikNavigation:RadTileView.ItemTemplate> |
| <telerikNavigation:RadTileView.ContentTemplate> |
| <DataTemplate> |
| <telerik:RadFluidContentControl telerikAnimation:AnimationManager.IsAnimationEnabled="True" |
| SmallToNormalThreshold="291, 130" |
| NormalToSmallThreshold="291, 130" |
| NormalToLargeThreshold="730, 350" |
| LargeToNormalThreshold="730, 350"> |
| <telerik:RadFluidContentControl.SmallContent> |
| <Border Width="193" Height="30"> |
| <TextBlock Text="Small Content" Style="{StaticResource SmallBox}"/> |
| </Border> |
| </telerik:RadFluidContentControl.SmallContent> |
| <telerik:RadFluidContentControl.Content> |
| <Border Width="279" Height="130"> |
| <TextBlock Text="Content" Style="{StaticResource SmallBox}"/> |
| </Border> |
| </telerik:RadFluidContentControl.Content> |
| <telerik:RadFluidContentControl.LargeContent> |
| <Border Width="730" Height="350"> |
| <TextBlock Text="Large Content" Style="{StaticResource SmallBox}"/> |
| </Border> |
| </telerik:RadFluidContentControl.LargeContent> |
| </telerik:RadFluidContentControl> |
| </DataTemplate> |
| </telerikNavigation:RadTileView.ContentTemplate> |
| </telerikNavigation:RadTileView> |
public App(){ InitializeComponent(); SetTheme("Expression_Dark");}public void SetTheme(string themeName){ Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri("/Telerik.Windows.Themes." + themeName + ";component/Themes/System.Windows.xaml", UriKind.RelativeOrAbsolute) }); Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri("/Telerik.Windows.Themes." + themeName + ";component/Themes/Telerik.Windows.Controls.xaml", UriKind.RelativeOrAbsolute) }); // ... plus more merged resources}<tk:RadWindow x:Class="GridViewTesting.RadGridView.RadGridViewVw" x:ClassModifier="internal" xmlns:rgv="clr-namespace:GridViewTesting.RadGridView" Header="Telerik RadGridView Demo" Height="600" Width="500"> <tk:RadWindow.Resources> <Style TargetType="rgv:RadGridViewVw" BasedOn="{StaticResource RadWindowStyle}"/> </tk:RadWindow.Resources> <!-- Controls defined here. --></tk:RadWindow>I'm using RadControls for WPF Q1 2010 in WPF solution with the MVVM pattern.
When I implemented the RadDock control the ContextMenu of the controls inside the RadPanes stopped showing up. Instead the RadPane context menu pops up with the options: Floating, Dockable etc. If I place the exact same control (StackPanel in my case) in a data tamplate and reference it from the ContentTemplate property of the RadPane as shown below it work fine. This however is not an acceptable workaround in my case. Please help me.
| <telerikDocking:RadSplitContainer Orientation="Vertical" InitialPosition="DockedRight"> |
| <telerikDocking:RadPaneGroup> |
| <telerikDocking:RadPane x:Name="Pane1" Header="Not Working ContextMenu" IsPinned="True" > |
| <StackPanel> |
| <TextBlock TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit."/> |
| <StackPanel.ContextMenu> |
| <ContextMenu> |
| <MenuItem Header="Add" /> |
| <MenuItem Header="Edit" /> |
| <Separator/> |
| <MenuItem Header="Delete" /> |
| </ContextMenu> |
| </StackPanel.ContextMenu> |
| </StackPanel> |
| </telerikDocking:RadPane> |
| </telerikDocking:RadPaneGroup> |
| <telerikDocking:RadPaneGroup> |
| <telerikDocking:RadPane Header="Working ContextMenu" IsPinned="True" ContentTemplate="{StaticResource template1}" /> |
| </telerikDocking:RadPaneGroup> |
| </telerikDocking:RadSplitContainer> |

Hi,
I have a problem with RadListBox that I think is a bug.
If styles MergedDictionaries in App.xaml and remove selected item not problem only problem styles MergedDictionaries in MainWindow.xaml remove item exception error.
Microsoft listbox in both cases no problem.
Please see uploaded project.
http://www.solidfiles.com/d/c9a834481c
Thanks so much.
Style:
<ResourceDictionary xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Brushes.xaml"/> </ResourceDictionary.MergedDictionaries> <!--CONTACT LIST BOX ITEM STYLE --> <ControlTemplate TargetType="telerik:RadListBoxItem" x:Key="ListBoxItemTemplate"> <Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"/> <VisualState x:Name="Disabled"/> </VisualStateGroup> <VisualStateGroup x:Name="SelectionStates"> <VisualStateGroup.Transitions> <VisualTransition GeneratedDuration="0:0:0.3"> <VisualTransition.GeneratedEasingFunction> <CircleEase EasingMode="EaseOut"/> </VisualTransition.GeneratedEasingFunction> </VisualTransition> </VisualStateGroup.Transitions> <VisualState x:Name="Unselected"/> <VisualState x:Name="Selected"> <Storyboard> <DoubleAnimation Duration="0" To="200" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="selectedGrid"/> </Storyboard> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="FocusStates"> <VisualStateGroup.Transitions> <VisualTransition GeneratedDuration="0:0:0.3"> <VisualTransition.GeneratedEasingFunction> <CircleEase EasingMode="EaseOut"/> </VisualTransition.GeneratedEasingFunction> </VisualTransition> </VisualStateGroup.Transitions> <VisualState x:Name="Focused"> <Storyboard> <!--DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="focus"/>--> </Storyboard> </VisualState> <VisualState x:Name="Unfocused"/> </VisualStateGroup> <VisualStateGroup x:Name="ValidationStates"/> </VisualStateManager.VisualStateGroups> <Border x:Name="border" BorderThickness="{TemplateBinding BorderThickness}" Background="#FF434343" BorderBrush="#FF767676"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Grid x:Name="readOnlyGrid" Height="60" Margin="1,0,0,0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock Grid.Column="1" Text="{Binding AssemblyName}" TextWrapping="Wrap" FontFamily="Segoe UI" FontSize="14" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{StaticResource MainBrush}" Margin="20,0,0,0"/> </Grid> <Grid x:Name="selectedGrid" Height="0" Margin="1,0,0,0" Background="#FF434343"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition /> </Grid.ColumnDefinitions> <StackPanel Grid.Column="1" Margin="16" HorizontalAlignment="Left"> <TextBlock TextWrapping="Wrap" Text="{Binding Name}" FontFamily="Segoe UI Light" FontSize="24" Foreground="{DynamicResource AccentBrush}" HorizontalAlignment="Left"/> <TextBlock Text="{Binding Phone}" FontFamily="Segoe UI" FontSize="16" Foreground="{StaticResource MainBrush}" HorizontalAlignment="Left" Margin="0,2,0,0"/> <TextBlock Text="{Binding Zip}" FontFamily="Segoe UI" FontSize="12" Foreground="{StaticResource BasicBrush}" HorizontalAlignment="Left" Margin="0,2,0,0"/> </StackPanel> </Grid> </Grid> </Border> </Grid> </ControlTemplate> <Style TargetType="telerik:RadListBoxItem"> <Setter Property="Template" Value="{StaticResource ListBoxItemTemplate}"/> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Top" /> <Setter Property="Background" Value="#FF434343" /> <Setter Property="BorderBrush" Value="{StaticResource StrongBrush}" /> <Setter Property="BorderThickness" Value="8,0,1,1" /> <Setter Property="Foreground" Value="{StaticResource MarkerBrush}"/> <!--Setter Property="TabNavigation" Value="Local" />--> </Style> <!-- LIST BOX STYLE --> <Style TargetType="telerik:RadListBox"> <Setter Property="BorderThickness" Value="0" /> <Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="Background" Value="Transparent" /> <Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="VerticalContentAlignment" Value="Top" /> <Setter Property="IsTabStop" Value="False" /> <!--Setter Property="TabNavigation" Value="Once" />--> </Style></ResourceDictionary>
Brush:
<ResourceDictionary xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <telerik:Windows8Theme x:Key="Theme" /> <!--MAIN UI BRUSHES--> <SolidColorBrush x:Key="AccentBrush" telerik:Windows8Colors.Color="Accent" /> <SolidColorBrush x:Key="BasicBrush" telerik:Windows8Colors.Color="Basic" /> <SolidColorBrush x:Key="StrongBrush" telerik:Windows8Colors.Color="Strong" /> <SolidColorBrush x:Key="MainBrush" telerik:Windows8Colors.Color="Main" /> <SolidColorBrush x:Key="MarkerBrush" telerik:Windows8Colors.Color="Marker" /> <SolidColorBrush x:Key="ValidationBrush" telerik:Windows8Colors.Color="Validation" /> <!--CATHEGORY BRUSHES--> <SolidColorBrush x:Key="MailBrush" Color="#FF25A0DA" /> <SolidColorBrush x:Key="CallBrush" Color="#FFED1691" /> <SolidColorBrush x:Key="MeetBrush" Color="#FFDAA125" /> <!--STATUS / PRIORITY BRUSHES--> <SolidColorBrush x:Key="RedBrush" Color="#FFE61E26" /> <SolidColorBrush x:Key="YellowBrush" Color="#FFDAA125" /> <SolidColorBrush x:Key="GreenBrush" Color="#FF679700" /></ResourceDictionary>
Main XAML:
<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="RadListBoxTest.MainWindow" Title="MainWindow" Height="500" Width="800" > <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Brushes.xaml"/> <ResourceDictionary Source="RadListBoxStyle.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Grid> <telerik:RadListBox x:Name="RadListBox" ItemsSource="{Binding Assemblies}" SelectedIndex="0" SelectionMode="Extended" AllowDrop="True" Margin="0,0,0,69"/> <Button Content="Add Items" HorizontalAlignment="Center" VerticalAlignment="Bottom" Width="150" Height="30" Margin="246,0,396,0" Click="Button_Click_2"/> <Button Content="Remove Selected Items" HorizontalAlignment="Center" VerticalAlignment="Bottom" Width="150" Height="30" Click="Button_Click_1" Margin="463,0,179,0"/> </Grid></Window>public partial class MainWindow : Window{ public MainWindow() { InitializeComponent(); RadListBox.ItemsSource = Agencies; } private ObservableCollection<Agency> agencies; public ObservableCollection<Agency> Agencies { get { if (agencies == null) { agencies = new ObservableCollection<Agency>(); } return agencies; } } private void Button_Click_1(object sender, RoutedEventArgs e) { if (RadListBox.SelectedItems != null && RadListBox.SelectedItems.Count > 0) { var items = RadListBox.SelectedItems.OfType<Agency>().ToArray(); int selIdx = RadListBox.SelectedIndex; foreach (Agency i in items) Agencies.Remove(i); if (items.Length == 1) { if (selIdx < Agencies.Count) RadListBox.SelectedIndex = selIdx; else RadListBox.SelectedIndex = Agencies.Count - 1; } else RadListBox.SelectedIndex = Agencies.Count - 1; } } private void Button_Click_2(object sender, RoutedEventArgs e) { agencies.Add(new Agency("Exotic Liquids", "(171) 555-2222", "EC1 4SD")); agencies.Add(new Agency("New Orleans Cajun Delights", "(100) 555-4822", "70117")); agencies.Add(new Agency("Grandma Kelly's Homestead", "(313) 555-5735", "48104")); agencies.Add(new Agency("Tokyo Traders", "(03) 3555-5011", "100")); agencies.Add(new Agency("Cooperativa de Quesos 'Las Cabras'", "(98) 598 76 54", "33007")); agencies.Add(new Agency("Mayumi's", "(06) 431-7877", "545")); agencies.Add(new Agency("Pavlova, Ltd.", "(03) 444-2343", "3058")); agencies.Add(new Agency("Specialty Biscuits, Ltd.", "(161) 555-4448", "M14 GSD")); agencies.Add(new Agency("PB Knäckebröd AB", "031-987 65 43", "S-345 67")); agencies.Add(new Agency("Refrescos Americanas LTDA", "(11) 555 4640", "5442")); }}