Pending Review
Last Updated: 13 Dec 2019 15:01 by n/a

Hello,

I've got an issue and feel like it link to RadComboBox control.

I've got an application which displays a RadDocking with multiple elements. Some of them are RadCombobBox and they get their value from a view model.

Sometimes, and quite ofen, I've got an exception : "NullReferenceException occured in PresentationCore.dl" without more information... I can't find the origin of this exception since theis was thrown by an external code.

The awkward thing is that, when I put some breakpoints, I don't have the exception. It seems like there is a temporisation problem.

Here is an exemple of my view model code for a RadComboBox component :

        private IEnumerable<EnumMemberViewModel> _videoTypes;

        public IEnumerable<EnumMemberViewModel> VideoTypes
        {
            get
            {
                if (_videoTypes == null)
                {
                    _videoTypes = EnumDataSource.FromType<EVideoType>();
                }
                return _videoTypes;
            }
        }

        private EnumMemberViewModel _currentVideoType;
       
        public EnumMemberViewModel CurrentVideoType
        {
            get
            {
                return _currentVideoType;
            }
            set
            {
                if (_currentVideoType != value)
                {
                    _currentVideoType = value;
                    OnPropertyChanged(() => CurrentVideoType);
                    AcquireVideo.InvalidateCanExecute();
                }
            }
        }

And here my xaml code for my view (if it can help):

<UserControl x:Class="AltosIHM.SessionControlPaneRadDocking"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:system="clr-namespace:System;assembly=mscorlib"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:local="clr-namespace:AltosIHM"
             xmlns:resx="clr-namespace:AltosIHM.Properties" 
             xmlns:iMatlabWCF="clr-namespace:MatlabWCFInterface;assembly=MatlabWCFInterface"
             xmlns:iMatlabTreatment="clr-namespace:MatlabTreatmentInterface;assembly=MatlabTreatmentInterface"
             xmlns:maskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input" 
             mc:Ignorable="d" 
             MinHeight="300" d:DesignWidth="900">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="CommonStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <telerik:InvertedBooleanConverter x:Key="InvertBooleanConverter"/>
            <local:StringToDoubleConverter x:Key="StringToDoubleConverter"/>

            <Style TargetType="StackPanel" x:Key="HeaderElements">
                <Setter Property="Orientation" Value="Horizontal"/>
            </Style>

            <Style x:Key="TextHeader" TargetType="TextBlock">
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="Margin" Value="3 0"/>
            </Style>

            <Style x:Key="TextHeaderDocumentPane" TargetType="TextBlock" BasedOn="{StaticResource TextHeader}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadDocumentPane}}, Path=IsPinned}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="TextHeaderPane" TargetType="TextBlock" BasedOn="{StaticResource TextHeader}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadPane}}, Path=IsPinned}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="HeaderImg" TargetType="Image">
                <Setter Property="Width" Value="30"/>
            </Style>

            <Style TargetType="telerik:RadPane">
                <Setter Property="CanUserClose" Value="False"/>
                <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
                <Style.Triggers>
                    <Trigger Property="IsPinned" Value="False">
                        <Setter Property="RenderTransform">
                            <Setter.Value>
                                <TransformGroup>
                                    <RotateTransform Angle="90"/>
                                </TransformGroup>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="Margin" Value="0 0 3 0"/>
                    </Trigger>
                </Style.Triggers>
            </Style>

            <Style TargetType="telerik:RadDocumentPane">
                <Setter Property="CanUserClose" Value="False"/>
                <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
                <Style.Triggers>
                    <Trigger Property="IsPinned" Value="False">
                        <Setter Property="RenderTransform">
                            <Setter.Value>
                                <TransformGroup>
                                    <RotateTransform Angle="90"/>
                                </TransformGroup>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="Margin" Value="0 0 3 0"/>
                    </Trigger>
                </Style.Triggers>
            </Style>


            <Style x:Key="ParametersTitle" TargetType="TextBlock" BasedOn="{StaticResource CategoryTitle}">
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="Margin" Value="10"/>
            </Style>

            <Style x:Key="SessionParametersValue" TargetType="{x:Type Control}" BasedOn="{StaticResource ParametersValues}">
                <Setter Property="Width" Value="300"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
            </Style>

            <DataTemplate x:Key="TreatmentsTemplate" DataType="{x:Type iMatlabTreatment:ITreatment}">
                <Button Style="{StaticResource TileButton}" IsEnabled="{Binding IsManageableByIHM}"
                                                    CommandParameter="{Binding}"
                                                    Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=local:SessionControlPaneRadDocking}, Path=DataContext.ActiveTreatment}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>

                        <Image Source="{Binding IconPath}"/>
                        <Label Grid.Row="1" Content="{Binding MatlabTreatmentExternalName}"
                                               FontWeight="Bold" HorizontalAlignment="Center"/>
                    </Grid>
                </Button>
            </DataTemplate>
            <ItemsPanelTemplate x:Key="TreatmentItemPanel">
                <WrapPanel x:Name="PropertiesWrapPanel" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadPaneGroup}}, Path=ActualWidth}"/>
            </ItemsPanelTemplate>

            <DataTemplate x:Key="IntCameraProperty">
                <StackPanel Margin="0 3">
                    <TextBlock Width="180" Text="{Binding Name}" Style="{StaticResource ParametersTitle}"/>
                    <telerik:RadNumericUpDown Value="{Binding IHMValue}" Style="{StaticResource SessionParametersValue}"
                                            IsEnabled="{Binding Accessible}" HideTrailingZeros="True"/>
                </StackPanel>
            </DataTemplate>
            <DataTemplate x:Key="IntBoundedCameraProperty">
                <StackPanel Margin="0 3">
                    <TextBlock Width="180" Text="{Binding Name}" Style="{StaticResource ParametersTitle}"/>
                    <DockPanel>
                        <telerik:RadNumericUpDown Value="{Binding IHMValue}" Style="{StaticResource SessionParametersValue}"
                                            IsEnabled="{Binding Accessible}" HideTrailingZeros="True"
                                                Minimum="{Binding ConstraintValueInt[0]}" Maximum="{Binding ConstraintValueInt[1]}"/>
                    </DockPanel>
                </StackPanel>
            </DataTemplate>
            <DataTemplate x:Key="DoubleCameraProperty">
                <StackPanel Margin="0 3">
                    <TextBlock Width="180" Text="{Binding Name}" Style="{StaticResource ParametersTitle}"/>
                    <telerik:RadNumericUpDown Value="{Binding IHMValue, Converter={StaticResource StringToDoubleConverter}}" NumberDecimalDigits="16"
                                                IsEnabled="{Binding Accessible}" Style="{StaticResource SessionParametersValue}" />
                </StackPanel>
            </DataTemplate>
            <DataTemplate x:Key="DoubleBoundedCameraProperty">
                <StackPanel Margin="0 3">
                    <TextBlock Width="180" Text="{Binding Name}" Style="{StaticResource ParametersTitle}"/>
                    <telerik:RadNumericUpDown Value="{Binding IHMValue, Converter={StaticResource StringToDoubleConverter}}"
                                                IsEnabled="{Binding Accessible}" NumberDecimalDigits="16"
                                                Minimum="{Binding ConstraintValueDouble[0]}"
                                                Maximum="{Binding ConstraintValueDouble[1]}"
                                                Style="{StaticResource SessionParametersValue}" />
                </StackPanel>
            </DataTemplate>
            <DataTemplate x:Key="StringCameraProperty">
                <StackPanel Margin="0 3">
                    <TextBlock Text="{Binding Name}" Style="{StaticResource ParametersTitle}"/>
                    <TextBox Text="{Binding IHMValue}" Style="{StaticResource SessionParametersValue}" IsReadOnly="{Binding Accessible, Converter={StaticResource InvertBooleanConverter}}"/>
                </StackPanel>
            </DataTemplate>
            <DataTemplate x:Key="EnumCameraProperty">
                <StackPanel Margin="0 3">
                    <TextBlock Text="{Binding Name}" Style="{StaticResource ParametersTitle}"/>
                    <telerik:RadComboBox ItemsSource="{Binding ConstraintValueString}" SelectedValue="{Binding IHMValue}" 
                                        IsReadOnly="{Binding Accessible, Converter={StaticResource InvertBooleanConverter}}"
                                        Width="300" HorizontalAlignment="Left"/>
                </StackPanel>
            </DataTemplate>

            <DataTemplate x:Key="CameraPropertiesTemplate">
                <ContentControl Content="{Binding}">
                    <ContentControl.Style>
                        <Style TargetType="ContentControl">
                            <Style.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Type}" Value="{x:Static iMatlabWCF:ETypeCameraProperty.Int}"/>
                                        <Condition Binding="{Binding IsConstraintValueExist}" Value="False"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="ContentTemplate" Value="{StaticResource IntCameraProperty}"/>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Type}" Value="{x:Static iMatlabWCF:ETypeCameraProperty.Int}"/>
                                        <Condition Binding="{Binding IsConstraintValueExist}" Value="True"/>
                                        <Condition Binding="{Binding Constraint}" Value="bounded"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="ContentTemplate" Value="{StaticResource IntBoundedCameraProperty}"/>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Type}" Value="{x:Static iMatlabWCF:ETypeCameraProperty.Double}"/>
                                        <Condition Binding="{Binding IsConstraintValueExist}" Value="False"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="ContentTemplate" Value="{StaticResource DoubleCameraProperty}"/>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Type}" Value="{x:Static iMatlabWCF:ETypeCameraProperty.Double}"/>
                                        <Condition Binding="{Binding IsConstraintValueExist}" Value="True"/>
                                        <Condition Binding="{Binding Constraint}" Value="bounded"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="ContentTemplate" Value="{StaticResource DoubleBoundedCameraProperty}"/>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Type}" Value="{x:Static iMatlabWCF:ETypeCameraProperty.String}"/>
                                        <Condition Binding="{Binding IsConstraintValueExist}" Value="False"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="ContentTemplate" Value="{StaticResource StringCameraProperty}"/>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Type}" Value="{x:Static iMatlabWCF:ETypeCameraProperty.String}"/>
                                        <Condition Binding="{Binding IsConstraintValueExist}" Value="True"/>
                                        <Condition Binding="{Binding Constraint}" Value="enum"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="ContentTemplate" Value="{StaticResource EnumCameraProperty}"/>
                                </MultiDataTrigger>
                            </Style.Triggers>
                        </Style>
                    </ContentControl.Style>
                </ContentControl>
            </DataTemplate>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid>
        <DockPanel Background="LightGray">
            <telerik:RadDocking Name="SessionMainPanel" PaneActivationMode="LastActivated" Background="LightGray" 
                                ElementLoaded="SessionMainPanel_ElementLoaded">
                <telerik:RadDocking.DocumentHost>
                    <telerik:RadSplitContainer>
                        <telerik:RadPaneGroup Background="AliceBlue" telerik:StyleManager.Theme="Fluent">
                            <telerik:RadDocumentPane Title="{x:Static resx:Resources.Treatments}" telerik:RadDocking.SerializationTag="TreatmentsPane"
                                                     CanUserClose="False" IsDragDisabled="True">
                                <telerik:RadDocumentPane.Header>
                                    <StackPanel x:Name="TreamtentPanel" Style="{StaticResource HeaderElements}">
                                        <TextBlock Text="{x:Static resx:Resources.Treatments}" Style="{StaticResource TextHeaderDocumentPane}"/>
                                        <Image Source="/icons/matlab.png" Style="{StaticResource HeaderImg}"/>
                                    </StackPanel>
                                </telerik:RadDocumentPane.Header>
                                <telerik:RadTileList ItemsSource="{Binding Treatments}" ItemTemplate="{StaticResource TreatmentsTemplate}"
                                         HorizontalAlignment="Center" VerticalTilesAlignment="Center">
                                </telerik:RadTileList>
                            </telerik:RadDocumentPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                </telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer InitialPosition="DockedLeft" telerik:StyleManager.Theme="Fluent">
                    <telerik:RadPaneGroup>
                        <telerik:RadPane Title="{x:Static resx:Resources.CameraParameters}" telerik:RadDocking.SerializationTag="CameraParamsPane"
                                         IsPinned="False" CanUserClose="False">
                            <telerik:RadPane.Header>
                                <StackPanel x:Name="CameraParamsPanel" Style="{StaticResource HeaderElements}">
                                    <TextBlock Text="{x:Static resx:Resources.CameraParameters}" Style="{StaticResource TextHeaderPane}"/>
                                    <Image Source="/icons/camera.png" Style="{StaticResource HeaderImg}"/>
                                </StackPanel>
                            </telerik:RadPane.Header>
                            <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden" Width="Auto" Background="#f6fcff" >
                                <ScrollViewer.Resources>
                                    <Style TargetType="TextBlock">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding AllCameraProperties.Count}" Value="0">
                                                <Setter Property="Visibility" Value="Visible"/>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>

                                    <Style TargetType="StackPanel">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding AllCameraProperties.Count}" Value="0">
                                                <Setter Property="Visibility" Value="Collapsed"/>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </ScrollViewer.Resources>
                                <Grid>
                                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="25"
                                    Margin="0 25" Style="{StaticResource CategoryTitle}" Visibility="Collapsed"
                                    Text="{x:Static resx:Resources.NoCameraProperty}"/>
                                    <StackPanel>
                                        <ListView HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"
                                                  ItemsSource="{Binding AllCameraProperties}" Background="#eff9ff"
                                                  ItemTemplate="{StaticResource CameraPropertiesTemplate}"
                                                  ItemsPanel="{StaticResource TreatmentItemPanel}"/>
                                        <WrapPanel HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 70 0">
                                            <telerik:RadButton Margin="10"
                                                    Command="{Binding WriteProperties}" Content="{x:Static resx:Resources.WriteParameters}"/>

                                            <telerik:RadButton Margin="10" 
                                                    Command="{Binding ResetProperties}" Content="{x:Static resx:Resources.ResetParameters}"/>

                                            <telerik:RadButton Margin="10"
                                                    Command="{Binding SetProperties}" Content="{x:Static resx:Resources.SetParameters}"/>

                                        </WrapPanel>
                                    </StackPanel>
                                </Grid>
                            </ScrollViewer>
                        </telerik:RadPane>
                        <telerik:RadPane Title="{x:Static resx:Resources.AcquisitionParameters}" telerik:RadDocking.SerializationTag="AcquisitionParamsPane"
                                         IsPinned="False" CanUserClose="False">
                            <telerik:RadPane.Header>
                                <StackPanel x:Name="AcquisitionParamsPanel" Style="{StaticResource HeaderElements}">
                                    <TextBlock Text="{x:Static resx:Resources.AcquisitionParameters}" Style="{StaticResource TextHeaderPane}"/>
                                    <Image Source="/icons/acquisitionParams.png" Style="{StaticResource HeaderImg}"/>
                                </StackPanel>
                            </telerik:RadPane.Header>
                            <ScrollViewer VerticalScrollBarVisibility="Visible">
                                <StackPanel Background="#f6fcff">
                                    <telerik:RadExpander Header="{x:Static resx:Resources.Images}" Background="LightSteelBlue" IsExpanded="True">
                                        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden">
                                            <Grid x:Name="ImagesParametersGrid" Background="#f6fcff">
                                                <Grid.Resources>
                                                    <Style TargetType="StackPanel">
                                                        <Setter Property="Margin" Value="10 8"/>
                                                    </Style>
                                                </Grid.Resources>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                </Grid.RowDefinitions>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition/>
                                                </Grid.ColumnDefinitions>

                                                <StackPanel>
                                                    <TextBlock Text="{x:Static resx:Resources.FrameTrigger}" Style="{StaticResource CategoryTitle}"/>
                                                    <telerik:RadNumericUpDown Style="{StaticResource SessionParametersValue}"
                                                          Value="{Binding FramePerTriggerNumber}" HideTrailingZeros="True" Minimum="0"/>
                                                </StackPanel>

                                                <StackPanel Grid.Column="1">
                                                    <TextBlock Text="{x:Static resx:Resources.TriggerRepeat}" Style="{StaticResource CategoryTitle}"/>
                                                    <telerik:RadNumericUpDown Style="{StaticResource SessionParametersValue}"
                                                          Value="{Binding TriggerRepeatNumber}" HideTrailingZeros="True" Minimum="0"/>
                                                </StackPanel>

                                                <StackPanel Grid.Column="2">
                                                    <TextBlock Text="{x:Static resx:Resources.TriggerFrameDelay}" Style="{StaticResource CategoryTitle}"/>
                                                    <telerik:RadNumericUpDown Style="{StaticResource SessionParametersValue}"
                                                          Value="{Binding TriggerFrameDelayNumber}" HideTrailingZeros="True" Minimum="0"/>
                                                </StackPanel>

                                                <StackPanel Grid.Row="1">
                                                    <TextBlock Text="{x:Static resx:Resources.FrameGrabInterval}" Style="{StaticResource CategoryTitle}"/>
                                                    <telerik:RadNumericUpDown Style="{StaticResource SessionParametersValue}"
                                                          Value="{Binding FrameGrabInterval}" HideTrailingZeros="True" Minimum="1"/>
                                                </StackPanel>

                                                <StackPanel Grid.Row="1" Grid.Column="1">
                                                    <TextBlock Text="{x:Static resx:Resources.TriggerType}" Style="{StaticResource CategoryTitle}"/>
                                                    <telerik:RadComboBox ItemsSource="{Binding Types}" SelectedIndex="1" SelectedItem="{Binding CurrentType, Mode=TwoWay}" Width="300" HorizontalAlignment="Left"/>
                                                </StackPanel>

                                                <StackPanel Grid.Row="1" Grid.Column="2">
                                                    <TextBlock Text="{x:Static resx:Resources.FilePrefix}" Style="{StaticResource CategoryTitle}"/>
                                                    <TextBox Style="{StaticResource SessionParametersValue}" Text="{Binding FilePrefix}"/>
                                                </StackPanel>


                                                <Grid Grid.Row="2" Grid.ColumnSpan="3" Margin="10 8">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition/>
                                                    </Grid.ColumnDefinitions>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition/>
                                                        <RowDefinition/>
                                                        <RowDefinition/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{x:Static resx:Resources.ImagesDirectory}" Style="{StaticResource CategoryTitle}"/>
                                                    <TextBox IsReadOnly="True" Text="{Binding FolderName}" Style="{StaticResource SessionParametersValue}" Width="Auto" HorizontalAlignment="Stretch" Grid.Row="1"/>
                                                    <telerik:RadButton Margin="8" HorizontalAlignment="Right" Grid.Row="2"
                                                   Content="{x:Static resx:Resources.ChooseFolder}" 
                                                   Command="{Binding ChooseFolder}"/>
                                                </Grid>

                                                <StackPanel Grid.Row="3">
                                                    <TextBlock Text="{x:Static resx:Resources.GenerateMean}" Style="{StaticResource CategoryTitle}"/>
                                                    <telerik:RadToggleButton Style="{StaticResource RadToggleSwitch}" HorizontalAlignment="Left" Margin="20 0 0 0"
                                                                 IsChecked="{Binding IsMeanGenerate}"/>
                                                </StackPanel>

                                                <StackPanel Grid.Row="3" Grid.Column="1">
                                                    <TextBlock Text="{x:Static resx:Resources.Format}" Style="{StaticResource CategoryTitle}"/>
                                                    <telerik:RadComboBox ItemsSource="{Binding Formats}" SelectedIndex="0" SelectedItem="{Binding CurrentFormat, Mode=TwoWay}" Width="300" HorizontalAlignment="Left"/>
                                                </StackPanel>

                                                <StackPanel Grid.Row="3" Grid.Column="2">
                                                    <TextBlock Text="{x:Static resx:Resources.BitDepth}" Style="{StaticResource CategoryTitle}"/>
                                                    <telerik:RadToggleButton Style="{StaticResource RadToggleSwitch}" HorizontalAlignment="Left" Margin="20 0 0 0"
                                                                 IsChecked="{Binding ApplyBitDepth}"/>
                                                </StackPanel>
                                            </Grid>
                                        </ScrollViewer>
                                    </telerik:RadExpander>

                                    <telerik:RadExpander  Header="{x:Static resx:Resources.Video}" Background="LightSteelBlue" IsExpanded="True">
                                        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden">
                                            <Grid x:Name="VideoParametersGrid" Background="#f6fcff">
                                                <Grid.Resources>
                                                    <Style TargetType="StackPanel">
                                                        <Setter Property="Margin" Value="10 5"/>
                                                    </Style>
                                                </Grid.Resources>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                </Grid.RowDefinitions>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition/>
                                                </Grid.ColumnDefinitions>

                                                <Grid Grid.ColumnSpan="2" Margin="10 8">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition/>
                                                    </Grid.ColumnDefinitions>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition/>
                                                        <RowDefinition/>
                                                        <RowDefinition/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{x:Static resx:Resources.VideoDirectory}" Style="{StaticResource CategoryTitle}"/>
                                                    <TextBox IsReadOnly="True" Text="{Binding VideoFolderName}" Style="{StaticResource SessionParametersValue}" Width="Auto" HorizontalAlignment="Stretch" Grid.Row="1"/>
                                                    <telerik:RadButton Margin="8" HorizontalAlignment="Right" Grid.Row="2"
                                                   Content="{x:Static resx:Resources.ChooseFolder}" 
                                                   Command="{Binding ChooseVideoFolder}"/>
                                                </Grid>

                                                <StackPanel Grid.Row="1">
                                                    <TextBlock Text="{x:Static resx:Resources.FileName}" Style="{StaticResource CategoryTitle}"/>
                                                    <TextBox Style="{StaticResource SessionParametersValue}" Text="{Binding VideoFileName}"/>
                                                </StackPanel>

                                                <StackPanel Grid.Row="1" Grid.Column="1">
                                                    <TextBlock Text="{x:Static resx:Resources.Format}" Style="{StaticResource CategoryTitle}"/>
                                                    <telerik:RadComboBox ItemsSource="{Binding VideoTypes}" SelectedIndex="2" SelectedItem="{Binding CurrentVideoType, Mode=TwoWay}" Width="300" HorizontalAlignment="Left"/>
                                                </StackPanel>
                                            </Grid>
                                        </ScrollViewer>
                                    </telerik:RadExpander>
                                </StackPanel>
                            </ScrollViewer>
                        </telerik:RadPane>
                        <telerik:RadPane Title="{x:Static resx:Resources.TreatmentParameters}" telerik:RadDocking.SerializationTag="TreatmentParamsPane"
                                         IsPinned="False" CanUserClose="False">
                            <telerik:RadPane.Header>
                                <StackPanel x:Name="TreatmentsParamsPanel" Style="{StaticResource HeaderElements}">
                                    <TextBlock Text="{x:Static resx:Resources.TreatmentParameters}" Style="{StaticResource TextHeaderPane}"/>
                                    <Image Source="/icons/settings.png" Style="{StaticResource HeaderImg}"/>
                                </StackPanel>
                            </telerik:RadPane.Header>
                            <StackPanel>
                                <TextBlock Text="{x:Static resx:Resources.DefaultColor}" Style="{StaticResource CategoryTitle}"/>
                                <telerik:RadColorEditor SelectedColor="{Binding ColorTreatments, Mode=TwoWay}" ColorMode="RGB" />
                            </StackPanel>
                        </telerik:RadPane>
                        <telerik:RadPane Title="{x:Static resx:Resources.ViewerParameters}" telerik:RadDocking.SerializationTag="ViewerParamsPane"
                                         IsPinned="False" CanUserClose="False">
                            <telerik:RadPane.Header>
                                <StackPanel x:Name="ViewerParamsPanel" Style="{StaticResource HeaderElements}">
                                    <TextBlock Text="{x:Static resx:Resources.ViewerParameters}" Style="{StaticResource TextHeaderPane}"/>
                                    <Image Source="/icons/viewerParams.png" Style="{StaticResource HeaderImg}"/>
                                </StackPanel>
                            </telerik:RadPane.Header>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <StackPanel>
                                    <TextBlock Text="{x:Static resx:Resources.ColorsSpace}" Style="{StaticResource CategoryTitle}"/>
                                    <telerik:RadComboBox ItemsSource="{Binding ColorsSpaces}" SelectedIndex="0" SelectedItem="{Binding CurrentColorsSpace, Mode=TwoWay}" Width="300" HorizontalAlignment="Left"/>
                                </StackPanel>
                                <StackPanel Grid.Column="1">
                                    <StackPanel.Style>
                                        <Style TargetType="StackPanel">
                                            <Setter Property="IsEnabled" Value="False"/>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding CurrentColorsSpace.Value}" Value="{x:Static iMatlabWCF:EReturnedColorSpace.Bayer}">
                                                    <Setter Property="IsEnabled" Value="True"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </StackPanel.Style>
                                    <TextBlock Text="{x:Static resx:Resources.ColorFilter}" Style="{StaticResource CategoryTitle}"/>
                                    <telerik:RadComboBox ItemsSource="{Binding ColorFilter}" SelectedIndex="0" SelectedItem="{Binding CurrentColorFilter, Mode=TwoWay}" Width="300" HorizontalAlignment="Left"/>
                                </StackPanel>

                                <telerik:RadButton Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Margin="20 10"
                                           Command="{Binding UpdateColorsSapce}" Content="{x:Static resx:Resources.UpdateColorsSpace}"/>

                            </Grid>
                        </telerik:RadPane>
                        <telerik:RadPane Title="HiddenPane" IsPinned="False" telerik:RadDocking.SerializationTag="HiddenPane"
                                         Visibility="Hidden" Width="40" Height="0" Margin="0"/>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking>
        </DockPanel>
        <StackPanel x:Name="ButtonsPanel" Width="50" HorizontalAlignment="Left" VerticalAlignment="Bottom">
            <telerik:RadToggleButton ToolTip="{x:Static resx:Resources.Viewer}" Margin="5 2"
                                     IsChecked="{Binding Path=IsViewerDisplayed, Mode=OneWay}"
                                     Command="{Binding Path=ShowOrCloseViewerCommand}">
                <Image Source="/icons/viewer.png" Style="{StaticResource HeaderImg}"/>
            </telerik:RadToggleButton>
            <telerik:RadButton ToolTip="{x:Static resx:Resources.AcquireImages}" Command="{Binding AcquireImages}"
                               Margin="5 2" Padding="5" >
                <Image Source="/icons/acquireImg.png" Style="{StaticResource HeaderImg}"/>
            </telerik:RadButton>
            <telerik:RadToggleButton ToolTip="{Binding AcquireVideoLabel}" Command="{Binding AcquireVideo}" 
                                     IsChecked="{Binding IsAcquiringVideo, Mode=OneWayToSource}" Margin="5 2">
                <Image Source="/icons/acquireVideo.png" Style="{StaticResource HeaderImg}"/>
            </telerik:RadToggleButton>
        </StackPanel>
    </Grid>
</UserControl>
    


Pending Review
Last Updated: 29 Nov 2019 05:41 by Dimitar

To reproduce: 

- Select some cells within the same column using Ctrl+Click

- Use the context menu to copy the cells

This works in Excel when the cells are within the same column. 

Pending Review
Last Updated: 29 Nov 2019 09:33 by ADMIN

Hi Telerik-Team,

 

When creating a new item in the GridView by either mouse or insert button the row is not selected or highlighted.

I guess this is a bug, since a cell in the new row has focus but not the row.

 

Best regards,

Mats

Pending Review
Last Updated: 28 Nov 2019 15:18 by ADMIN

After installing the WPF software I was not able to open any project in VS 2017 without it hanging.

 

In the end I removed the VS integration and was able to resume development.

 

It was the only Telerik component I had installed. I can't find the version number but it was the latest of the website as of 17th Oct 2019.

 

Can you explain why this happened?

Pending Review
Last Updated: 22 Oct 2019 15:41 by ADMIN

when use the RadTransitionControl's SlideAndZoomTransition effect for the RadTabControl, the radComboBox Multiple Selection will lost in the  tabItem。

the  radComboBox data is from the mvvm binding,after change the tabitem,the Multiple Selection become single selection.

the RadTabControl's style is following:

           ...

           <ControlTemplate x:Key="TabControlTemplate" TargetType="telerik:RadTabControl">
        <Grid>
            <telerik:RadDockPanel LastChildFill="True">
                <telerik:LayoutTransformControl x:Name="HeaderDockedElement" telerik:RadDockPanel.Dock="Top">
                    <Grid SnapsToDevicePixels="True">
                        <Border x:Name="HeaderBackground" Background="{TemplateBinding HeaderBackground}" Visibility="{TemplateBinding BackgroundVisibility}"/>
                        <telerik:RadDockPanel Panel.ZIndex="10">
                            <telerik:LayoutTransformControl x:Name="AdditionalContentTransform" Margin="0" telerik1:RadDockPanel.Dock="Right">
                                <ContentPresenter x:Name="AdditionalContentElement" Content="{TemplateBinding AdditionalContent}"/>
                            </telerik:LayoutTransformControl>
                            <ToggleButton x:Name="DropDownButtonElement"
                                    Visibility="Collapsed"
                                    telerik:RadDockPanel.Dock="Right"
                                    Style="{TemplateBinding DropDownButtonStyle}"
                                    ClickMode="Press"
                                    IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
                                <telerik:RadContextMenu.ContextMenu>
                                    <telerikTabControl:DropDownMenu x:Name="DropDownMenuElement"
                                            StaysOpen="False"
                                            Placement="Bottom"
                                            Style="{TemplateBinding DropDownStyle}"
                                            ItemTemplate="{TemplateBinding ItemDropDownContentTemplate}"
                                            ItemTemplateSelector="{TemplateBinding ItemDropDownContentTemplateSelector}"
                                            DisplayMemberPath="{TemplateBinding DropDownDisplayMemberPath}"/>
                                </telerik:RadContextMenu.ContextMenu>
                            </ToggleButton>
                            <RepeatButton x:Name="LeftScrollButtonElement" Style="{StaticResource ScrollButtonStyle}">
                                <telerik:RadGlyph Glyph="{StaticResource GlyphArrowChevronLeft}"/>
                            </RepeatButton>
                            <RepeatButton x:Name="RightScrollButtonElement" Style="{StaticResource ScrollButtonStyle}" telerik:RadDockPanel.Dock="Right">
                                <telerik:RadGlyph Glyph="{StaticResource GlyphArrowChevronRight}"/>
                            </RepeatButton>
                            <ScrollViewer x:Name="ScrollViewerElement"
                                    Style="{StaticResource EmptyScrollViewerStyle}"
                                    VerticalScrollBarVisibility="Disabled"
                                    BorderThickness="0"
                                    IsTabStop="False"
                                    HorizontalScrollBarVisibility="{Binding (ScrollViewer.HorizontalScrollBarVisibility), RelativeSource={RelativeSource TemplatedParent}}">
                                <ItemsPresenter/>
                            </ScrollViewer>
                        </telerik:RadDockPanel>
                    </Grid>
                </telerik:LayoutTransformControl>
                <Border x:Name="ContentBorder"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Mode=TwoWay}"
                        Background="{TemplateBinding Background}"
                        Padding="{TemplateBinding Padding}">
                    <Grid>
                       
                        <telerik:RadTransitionControl x:Name="ContentElement"
                                            Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsContentPreserved,Converter={StaticResource InvertedBooleanToVisibilityConverter}}"
                                            Content="{TemplateBinding SelectedContent}"
                                            ContentTemplate="{TemplateBinding SelectedContentTemplate}"
                                            ContentTemplateSelector="{TemplateBinding SelectedContentTemplateSelector}"
                                            Duration="00:00:00.350">
                            <telerik:RadTransitionControl.Transition>
                                <local:TransitionSetFP>
                                    <local:TransitionSetFP.BackTransition>
                                        <telerik:SlideAndZoomTransition SlideDirection="LeftToRight" MinZoom="1" StartSlideAt="0.01" MinAlpha="1"/>
                                    </local:TransitionSetFP.BackTransition>
                                    <local:TransitionSetFP.ForwardTransition>
                                        <telerik:SlideAndZoomTransition SlideDirection="RightToLeft" MinZoom="1" StartSlideAt="0.01" MinAlpha="1"/>
                                    </local:TransitionSetFP.ForwardTransition>
                                </local:TransitionSetFP>
                            </telerik:RadTransitionControl.Transition>
                        </telerik:RadTransitionControl>
                        <Grid x:Name="ContentElementsPanel" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsContentPreserved, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                    </Grid>
                </Border>
            </telerik:RadDockPanel>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="DropDownDisplayMode" Value="Visible">
                <Setter Property="Visibility" Value="Visible" TargetName="DropDownButtonElement"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="DropDownDisplayMode" Value="WhenNeeded"/>
                    <Condition SourceName="ScrollViewerElement" Property="ComputedHorizontalScrollBarVisibility" Value="Visible"/>
                </MultiTrigger.Conditions>
                <Setter Property="Visibility" Value="Visible" TargetName="DropDownButtonElement"/>
            </MultiTrigger>
            <Trigger Property="TabStripPlacement" Value="Top">
                <Setter Property="BorderThickness" TargetName="ContentBorder" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={StaticResource ThicknessToOrientedThicknessConverter}, ConverterParameter=LeftBottomRight}"/>
            </Trigger>
            <Trigger Property="TabStripPlacement" Value="Left">
                <Setter TargetName="DropDownMenuElement" Property="HorizontalOffset" Value="0"/>
                <Setter TargetName="DropDownMenuElement" Property="VerticalOffset" Value="-3"/>
                <Setter Property="telerik:RadDockPanel.Dock" Value="Left" TargetName="HeaderDockedElement"/>
                <Setter Property="telerik:RadDockPanel.Dock" Value="Left" TargetName="AdditionalContentTransform"/>
                <Setter Property="telerik:RadDockPanel.Dock" Value="Left" TargetName="DropDownButtonElement"/>
                <Setter Property="LayoutTransform" TargetName="HeaderDockedElement">
                    <Setter.Value>
                        <RotateTransform Angle="-90"/>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderThickness" TargetName="ContentBorder" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={StaticResource ThicknessToOrientedThicknessConverter}, ConverterParameter=TopRightBottom}"/>
            </Trigger>
            <Trigger Property="TabStripPlacement" Value="Right">
                <Setter TargetName="DropDownMenuElement" Property="HorizontalOffset" Value="0"/>
                <Setter TargetName="DropDownMenuElement" Property="VerticalOffset" Value="3"/>
                <Setter Property="LayoutTransform" TargetName="HeaderDockedElement">
                    <Setter.Value>
                        <RotateTransform Angle="90"/>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderThickness" TargetName="ContentBorder" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={StaticResource ThicknessToOrientedThicknessConverter}, ConverterParameter=TopLeftBottom}"/>
            </Trigger>
            <Trigger Property="TabStripPlacement" Value="Bottom">
                <Setter TargetName="DropDownMenuElement" Property="HorizontalOffset" Value="3"/>
                <Setter Property="telerik:RadDockPanel.Dock" Value="Left" TargetName="AdditionalContentTransform"/>
                <Setter Property="telerik:RadDockPanel.Dock" Value="Left" TargetName="DropDownButtonElement"/>
                <Setter Property="LayoutTransform" TargetName="HeaderDockedElement">
                    <Setter.Value>
                        <RotateTransform Angle="180"/>
                    </Setter.Value>
                </Setter>
                <Setter Property="LayoutTransform" TargetName="AdditionalContentTransform">
                    <Setter.Value>
                        <RotateTransform Angle="180"/>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderThickness" TargetName="ContentBorder" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={StaticResource ThicknessToOrientedThicknessConverter}, ConverterParameter=TopRightLeft}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style TargetType="telerik:RadTabControl">
        <Setter Property="mat:MaterialAssist.ShadowDepth" Value="Depth1"/>
        <Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="HeaderBackground" Value="{telerik1:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryBackgroundBrush}"/>
        <Setter Property="MinWidth" Value="5"/>
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="FontFamily" Value="{telerik1:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Primitives:TabWrapPanel/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="DropDownButtonStyle" Value="{StaticResource DropDownButtonStyle}"/>
        <Setter Property="DropDownStyle" Value="{StaticResource DropDownMenuStyle}"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="Template" Value="{StaticResource TabControlTemplate}"/>
    </Style>