This is a migrated thread and some comments may be shown as answers.

Office2013 in ResourceDictionary

3 Answers 223 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christie Admin
Top achievements
Rank 1
Christie Admin asked on 28 Apr 2015, 08:24 PM

Hi,

I'm using V2015.1.225.45 of Telerik and and I have a problem using the Office2013 as with different controls. Our project is a DLL and we create a "GenericStyles.xaml" file which contain all of our customs styles. So, in our application, in each UserControl, we have added the following piece of code to reference our Custom Styles: 

 

            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/ChristieInnoMed.Framework.UI.ChristieControls;component/Resources/Controls/GenericStyles.xaml"/>

In our custom styles file, many sections are underline in blue with the error message: " Object reference not set to an instance of an object.". If you look in our GenericStyles.xam file, as an example, look at the section "x:Key="TextBoxErrorTemplate".

Our GenericStyles.xaml look like:

 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls">
    
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml" />
        <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml" />
        <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Input.xaml" />
        <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
    </ResourceDictionary.MergedDictionaries>
   
    <Style x:Key="ListBoxNoFocusSelectStyle" TargetType="{x:Type ListBoxItem}">
        <Style.Resources>
            <!-- SelectedItem with focus -->
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
                       Color="Transparent" />
            <!-- SelectedItem without focus -->
            <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}"
                       Color="Transparent" />
            <!-- SelectedItem text foreground -->
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}"
                       Color="Black" />
        </Style.Resources>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>

    <!-- Textbox error template -->
    <Style x:Key="TextBoxErrorTemplate" TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextBoxStyle}">        
        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <DockPanel>
                        <Grid DockPanel.Dock="Right"
                              Width="16"
                              Height="16"
                              VerticalAlignment="Center"
                              Margin="5 0 0 0"
                              ToolTip="{Binding ElementName=ErrorAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
                            <Ellipse Width="16" Height="16" Fill="Red"/>
                            <Ellipse Width="3" Height="8" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0 2 0 0" Fill="White"/>
                            <Ellipse Width="2" Height="2" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 2" Fill="White"/>
                        </Grid>
                        <Border BorderBrush="Red" BorderThickness="2" CornerRadius="2">
                            <AdornedElementPlaceholder x:Name="ErrorAdorner"/>
                        </Border>
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CustomExpanderStyle" TargetType="telerik:RadExpander" BasedOn="{StaticResource RadExpanderStyle}">
        <Setter Property="Padding" Value="10" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadExpander">
                    <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStateGroup">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="HeaderPanel" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="HeaderStateGroup">
                                <VisualState x:Name="NormalHeader"/>
                                <VisualState x:Name="MouseOverHeader">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="NormalCircle" Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterCircle" Storyboard.TargetProperty="Stroke" Duration="0:0:0">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Office2013Resource ResourceKey=AccentMainBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterCircle" Storyboard.TargetProperty="Fill" Duration="0:0:0">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Office2013Resource ResourceKey=EffectAccentLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Fill" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Office2013Resource ResourceKey=InvertedBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PressedHeader">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterCircle" Storyboard.TargetProperty="Fill" Duration="0:0:0">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Office2013Resource ResourceKey=EffectAccentHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterCircle" Storyboard.TargetProperty="Stroke" Duration="0:0:0">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Office2013Resource ResourceKey=AccentMainBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Fill" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Office2013Resource ResourceKey=InvertedBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="HeaderOrientationGroup">
                                <VisualState x:Name="HorizontalOrientation">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentTransform" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <RotateTransform Angle="0"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentTransform" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="VerticalOrientation">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentTransform" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <RotateTransform Angle="90"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentTransform" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpandStateGroup">
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <DoubleAnimation                                            
                                    Storyboard.TargetName="arrow"
                                    Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"
                                    To="180"
                                    Duration="0:0:0.2"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderButton" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Office2013Resource ResourceKey=InvertedBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation
                                    Storyboard.TargetName="arrow"
                                    Duration="0:0:0.2"
                                    Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"
                                    To="0"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpandDirectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition>
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="(Grid.Row)">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <sys:Int32>0</sys:Int32>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="(Grid.Column)">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <sys:Int32>0</sys:Int32>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderButton" Storyboard.TargetProperty="(Grid.Row)">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <sys:Int32>0</sys:Int32>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderButton" Storyboard.TargetProperty="(Grid.Column)">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <sys:Int32>0</sys:Int32>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="col0" Storyboard.TargetProperty="Width">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <GridLength>Auto</GridLength>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="col1" Storyboard.TargetProperty="Width">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <GridLength>Auto</GridLength>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="row0" Storyboard.TargetProperty="Height">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <GridLength>Auto</GridLength>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="row1" Storyboard.TargetProperty="Height">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <GridLength>Auto</GridLength>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="DirectionLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="col0" Storyboard.TargetProperty="Width">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <GridLength>*</GridLength>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="row0" Storyboard.TargetProperty="Height">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <GridLength>*</GridLength>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderButton" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="arrowPanel" Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle" To="90" Duration="0:0:0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DirectionRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="col1" Storyboard.TargetProperty="Width">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <GridLength>*</GridLength>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="row0" Storyboard.TargetProperty="Height">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <GridLength>*</GridLength>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="arrowPanel" Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle" To="-90" Duration="0:0:0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DirectionUp">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="col0" Storyboard.TargetProperty="Width">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <GridLength>*</GridLength>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="row0" Storyboard.TargetProperty="Height">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <GridLength>*</GridLength>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderButton" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="arrowPanel" Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle" To="180" Duration="0:0:0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DirectionDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="col0" Storyboard.TargetProperty="Width">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <GridLength>*</GridLength>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="row1" Storyboard.TargetProperty="Height">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <GridLength>*</GridLength>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <!--<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">-->
                        <Border BorderBrush="{telerik:Office2013Resource ResourceKey=AccentBrush}" BorderThickness="1" Background="{TemplateBinding Background}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition x:Name="row0" Height="Auto"/>
                                    <RowDefinition x:Name="row1" Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="col0" Width="Auto"/>
                                    <ColumnDefinition x:Name="col1" Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <Border Background="{telerik:Office2013Resource ResourceKey=AccentBrush}" Grid.ColumnSpan="2"/>
                                <telerik:RadToggleButton x:Name="HeaderButton"
                            TabIndex="{TemplateBinding TabIndex}"
                            HorizontalAlignment="{TemplateBinding HorizontalHeaderAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalHeaderAlignment}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalHeaderAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalHeaderAlignment}"
                            Template="{StaticResource ToggleTemplate}"
                            Background="Transparent"
                            IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                            ClickMode="{TemplateBinding ClickMode}"
                            FontSize="{TemplateBinding FontSize}"
                            FontStyle="{TemplateBinding FontStyle}"
                            FontWeight="{TemplateBinding FontWeight}"
                            FontFamily="{TemplateBinding FontFamily}"
                            FontStretch="{TemplateBinding FontStretch}"
                            Foreground="{TemplateBinding Foreground}">
                                    <telerik:RadToggleButton.FocusVisualStyle>
                                        <Style>
                                            <Setter Property="Control.Template">
                                                <Setter.Value>
                                                    <ControlTemplate>
                                                        <Border>
                                                            <Rectangle Margin="0" SnapsToDevicePixels="True" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2"/>
                                                        </Border>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </telerik:RadToggleButton.FocusVisualStyle>
                                    <Grid x:Name="HeaderPanel" Background="Transparent">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid>
                                            <Ellipse x:Name="NormalCircle"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Width="22"
                                        Height="22"
                                        Fill="{telerik:Office2013Resource ResourceKey=BasicBrush}"
                                        Stroke="{telerik:Office2013Resource ResourceKey=HighDarkBrush}"
                                        StrokeThickness="1"/>
                                            <Ellipse x:Name="OuterCircle" HorizontalAlignment="Center" VerticalAlignment="Center" Stroke="{x:Null}" Fill="{x:Null}" Width="22" Height="22" StrokeThickness="1"/>
                                            <Grid RenderTransformOrigin="0.5 0.5" x:Name="arrowPanel">
                                                <Grid.RenderTransform>
                                                    <RotateTransform/>
                                                </Grid.RenderTransform>
                                                <Path x:Name="arrow"
                                            Stretch="None"
                                            RenderTransformOrigin="0.5,0.5"
                                            Width="8"
                                            Height="4"
                                            Data="M0,0 L0.67,0 4,2.67 7.25,0 8,0 8,0.67 4,4 0,0.75 z"
                                            Fill="{telerik:Office2013Resource ResourceKey=StrongBrush}">
                                                    <Path.RenderTransform>
                                                        <TransformGroup>
                                                            <RotateTransform Angle="0"/>
                                                            <TranslateTransform/>
                                                        </TransformGroup>
                                                    </Path.RenderTransform>
                                                </Path>
                                            </Grid>
                                        </Grid>
                                        <telerikPrimitives:LayoutTransformControl RenderTransformOrigin=".5 .5" x:Name="HeaderContentTransform">
                                            <ContentPresenter x:Name="HeaderContent"
                                        Grid.Column="1"
                                        Margin="5 0"
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Stretch"
                                        UseLayoutRounding="True"
                                        Content="{TemplateBinding Header}"
                                        ContentTemplate="{TemplateBinding HeaderTemplate}"
                                        TextBlock.Foreground="{telerik:Office2013Resource ResourceKey=LowLightBrush}"/>
                                        </telerikPrimitives:LayoutTransformControl>
                                    </Grid>
                                </telerik:RadToggleButton>
                                <ContentPresenter x:Name="Content"                                                  
                            Margin="{TemplateBinding Padding}"
                            Visibility="Collapsed"
                            UseLayoutRounding="True"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CustomGroupBox" TargetType="GroupBox">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GroupBox">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <Border Grid.Row="0" 
                                BorderThickness="1"
                                BorderBrush="{telerik:Office2013Resource ResourceKey=AccentBrush}"
                                Background="{telerik:Office2013Resource ResourceKey=AccentBrush}">
                            <Label Foreground="{telerik:Office2013Resource ResourceKey=LowLightBrush}">
                                <ContentPresenter Margin="0"
                                                  ContentSource="Header"
                                                  RecognizesAccessKey="True" />
                            </Label>
                        </Border>

                        <Border Grid.Row="1"
                                BorderThickness="1,0,1,1"
                                BorderBrush="{telerik:Office2013Resource ResourceKey=AccentBrush}">
                            <ContentPresenter Margin="10" />
                        </Border>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CustomScrollViewer" TargetType="ScrollViewer" BasedOn="{StaticResource ScrollViewerStyle}">
        <Setter Property="Padding" Value="10" />
    </Style>

    <Style x:Key="CustomTabControl" TargetType="telerik:RadTabControl" BasedOn="{StaticResource RadTabControlStyle}">
        <Setter Property="Padding" Value="10" />
    </Style>

    <Style x:Key="CustomTabItemStyle" TargetType="telerik:RadTabItem" BasedOn="{StaticResource RadTabItemStyle}">
        <Setter Property="Height" Value="35" />
    </Style>

    <Style x:Key="CustomGridSplitter" TargetType="GridSplitter">
        <Setter Property="Background" Value="{telerik:Office2013Resource ResourceKey=AccentBrush}" />
        <Setter Property="Width" Value="10" />
    </Style>

    <Style x:Key="CustomLabelTitle" TargetType="Label">
        <Setter Property="Background" Value="{telerik:Office2013Resource ResourceKey=AccentBrush}" />
        <Setter Property="Foreground" Value="{telerik:Office2013Resource ResourceKey=LowLightBrush}" />
        <Setter Property="FontSize" Value="18" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Label">
                    <Border x:Name="_brdMain" 
                                        BorderThickness="{TemplateBinding BorderThickness}"
                                        BorderBrush="{TemplateBinding BorderBrush}" 
                                        Background="{TemplateBinding Background}"                                        
                                        CornerRadius="0,0,0,0"
                                        Padding="5 0 0 0"
                                        >
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CustomCheckBox" TargetType="CheckBox" BasedOn="{StaticResource CheckBoxStyle}">        
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="1.5" ScaleY="1.5" />                
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CustomCheckBoxText" TargetType="TextBlock">
        <Setter Property="Margin" Value="-15 0 0 0" />
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>
    
    <Style x:Key="CustomRadioButton" TargetType="RadioButton" BasedOn="{StaticResource RadioButtonStyle}">
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="1.5" ScaleY="1.5" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SmallWidthTextBox" TargetType="TextBox" BasedOn="{StaticResource TextBoxStyle}">
        <Setter Property="Width" Value="50" />
    </Style>

    <Style x:Key="CustomOkButtonContent" TargetType="ContentControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="5 0 0 0" Source="pack://application:,,,/ChristieInnoMed.Framework.UI.ChristieControls;component/Resources/Images/Save48x48.png" Height="24" Width="24" />
                        <TextBlock Margin="5 0 5 0" Text="Ok" VerticalAlignment="Center" />
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate x:Key="ToolTipTemplate">
        <Grid Width="210">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Border BorderBrush="White" Opacity="0.75" BorderThickness="1" Background="Black" UseLayoutRounding="True"/>
            <StackPanel>                
                <TextBlock Text="{Binding Title}" Foreground="White" Margin="5 5 5 10" FontFamily="Segoe UI" FontSize="11" FontWeight="SemiBold" />
                <TextBlock Text="{Binding Description}" Margin="5" FontFamily="Segoe UI" FontSize="11" TextWrapping="Wrap" Foreground="White"/>
            </StackPanel>
            <Path Data="M0,0L7,14L14,0" Fill="White" Stretch="Fill" Width="14" Height="7" UseLayoutRounding="True" Stroke="White" VerticalAlignment="Bottom" HorizontalAlignment="Center"  Grid.Row="1" Margin="0 -1 0 0"/>
        </Grid>
    </DataTemplate>
</ResourceDictionary>

 

Thank's

Alain

3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 30 Apr 2015, 02:52 PM
Hi Alain,

 It is hard to tell what is causing the problem on your side without your full code. There are too many styles in your resource dictionary. Are all of them causing you the error message ? Could you please isolate a sample runnable project and send it to us so that we can see your exact setup?

Looking forward to hearing from you.

Regards,
Evgenia
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Christie Admin
Top achievements
Rank 1
answered on 30 Apr 2015, 04:09 PM

Hi Evgenia,

 it's tried to isolate the problem since I posted in Telerik forum without any success :(

The problem exist only with the style which contain the "baseon" instruction. In this situation, the designer display one an error message but if I try to run the application, averything work perfectly.

 Messsage in the designer:

XamlParseException: XAML Node Stream: Missing StartObject before StartMember '{http://schemas.microsoft.com/winfx/2006/xaml}_Initialization'.

StackTrace
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadDeferredContent(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings parentSettings, Uri baseUri)
   at System.Windows.ResourceDictionary.CreateObject(KeyRecord key)
   at System.Windows.ResourceDictionary.OnGettingValue(Object key, Object& value, Boolean& canCache)
   at System.Windows.ResourceDictionary.OnGettingValuePrivate(Object key, Object& value, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
   at System.Windows.ResourceDictionary.ResourceDictionaryEnumerator.System.Collections.IDictionaryEnumerator.get_Entry()
   at System.Windows.ResourceDictionary.ResourceDictionaryEnumerator.System.Collections.IEnumerator.get_Current()

... 

 

Thank's

Alain

0
Evgenia
Telerik team
answered on 04 May 2015, 02:02 PM
Hello Alain,

Since we are not aware of such design-time problem with our NoXAML binaries may I ask you to perform the following steps:
1. Open the project and remove all Telerik's references.
2.  Save the project and close it.
3.  Open the project directory and delete "Bin" and "Obj" folders.
4.  Open the project and add the references.
5.  Clean and Build the project.

Sometimes this helps to resolve the designer's errors and I hope this will help you as well.
I'm sorry but the information you are providing is insufficient for us. Please send us a runnable stripped down version of your project where the design time issue reproduces so that we can further assist you. Also any further information that you can provide like the Visual Studio version you test with and the version of our controls will be very helpful.

Regards,
Evgenia
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Christie Admin
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Christie Admin
Top achievements
Rank 1
Share this question
or