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

RadToolBar problem with x64 cpu

2 Answers 92 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Sébastien Chicoine
Top achievements
Rank 1
Sébastien Chicoine asked on 03 Aug 2011, 01:28 PM

Hi,

   Recently, we have upgraded our computers from x86 platform to x64 platform.
 
   We have a project that run perfectly on x86 platform and when we tried to develop the project with our new computer we have the following error :

XamlParseException occured

Échec de l'assignation à la propriété (Property assignation failed) 'System.Windows.Setter.Value'. [Line: 12 Position: 44] .

We have made searches to find the cause the problem.  We find that, when we comment this line in the Assets\Style file, the project runs without error :

The line we commented :

<Setter Property="ItemContainerStyleSelector" Value="{StaticResource ToolBarContainerStyleSelector}"/>

The code where it is :

<Style x:Key="RadToolBarStyle1" TargetType="telerik:RadToolBar">

        <Setter Property="ItemContainerStyleSelector" Value="{StaticResource ToolBarContainerStyleSelector}"/>

        <Setter Property="MinWidth" Value="25"/>

        <Setter Property="Template">

            <Setter.Value>

                <ControlTemplate TargetType="telerik:RadToolBar">

                    <Grid x:Name="RootElement" MinHeight="24">

                        <Grid.ColumnDefinitions>

                            <ColumnDefinition x:Name="c0" Width="Auto"/>

                            <ColumnDefinition x:Name="c1" Width="*"/>

                            <ColumnDefinition x:Name="c2" Width="11"/>

                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>

                            <RowDefinition x:Name="r0" Height="*"/>

                            <RowDefinition x:Name="r1" Height="Auto"/>

                            <RowDefinition x:Name="r2" Height="Auto"/>

                        </Grid.RowDefinitions>

                        <VisualStateManager.VisualStateGroups>

                            <VisualStateGroup x:Name="CommonStateGroup">

                                <VisualState x:Name="Normal"/>

                                <VisualState x:Name="Disabled">

                                    <Storyboard>

                                        <DoubleAnimation Duration="0:0:0.2" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="RootElement"/>

                                    </Storyboard>

                                </VisualState>

                            </VisualStateGroup>

                            <VisualStateGroup x:Name="OrientationStateGroup">

                                <VisualState x:Name="Horizontal">

                                    <Storyboard>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="c1">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="c2">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="11"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="r0">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="r1">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="r2">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Orientation" Storyboard.TargetName="PART_StripPanel">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Horizontal"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="PART_StripPanel">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="PART_StripPanel">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_StripPanel">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0,1,4,1"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="DropdownButtonHolder">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="DropdownButtonHolder">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="DropdownButtonHolder">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="-6 0 0 0"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="GripOrnamentH">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="GripOrnamentV">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBackground">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ToolBar_InnerBackground}"/>

                                        </ObjectAnimationUsingKeyFrames>

                                    </Storyboard>

                                </VisualState>

                                <VisualState x:Name="Vertical">

                                    <Storyboard>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="c0">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="c1">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="c2">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Auto"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="r1">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="r2">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="10"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Orientation" Storyboard.TargetName="PART_StripPanel">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Vertical"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="PART_StripPanel">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="PART_StripPanel">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_StripPanel">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1,0,1,4"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="DropdownButtonHolder">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="DropdownButtonHolder">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="DropdownButtonHolder">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0 -6 0 0"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="LayoutTransform" Storyboard.TargetName="DropdownButtonHolder">

                                            <DiscreteObjectKeyFrame KeyTime="0">

                                               <DiscreteObjectKeyFrame.Value>

                                                    <TransformGroup>

                                                        <RotateTransform x:Name="ToolBarToggleButtonAngle" Angle="-90"/>

                                                        <ScaleTransform x:Name="ToolBarToggleButtonScale" ScaleY="-1" ScaleX="1"/>

                                                    </TransformGroup>

                                                </DiscreteObjectKeyFrame.Value>

                                            </DiscreteObjectKeyFrame>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="GripOrnamentH">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="GripOrnamentV">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>

                                        </ObjectAnimationUsingKeyFrames>

                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBackground">

                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ToolBar_InnerBackgroundV}"/>

                                        </ObjectAnimationUsingKeyFrames>

                                    </Storyboard>

                                </VisualState>

                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>

                        <telerik:LayoutTransformControl x:Name="DropdownButtonHolder" Background="{TemplateBinding Background}" Grid.Column="2" Margin="0" >

                            <ToggleButton x:Name="PART_DropdownButton" IsChecked="{TemplateBinding IsOverflowOpen}" Background="{TemplateBinding Background}" IsEnabled="{TemplateBinding HasOverflowItems}" Margin="0 0 0 0" Template="{StaticResource ToolBarDropdownButtonH}" />

                        </telerik:LayoutTransformControl>

                        <Popup x:Name="PART_Overflow" Grid.Column="2">

                            <Border Margin="0" MinWidth="55" MinHeight="33">

                                <Border BorderBrush="{StaticResource OverflowBorderInnerBrush}" BorderThickness="1" Background="{TemplateBinding Background}" Padding="1,2,1,2">

                                    <StackPanel x:Name="PART_OverflowPanel" Orientation="Vertical" VerticalAlignment="Top"/>

                                </Border>

                            </Border>

                        </Popup>

                        <Border x:Name="InnerBackground" BorderBrush="{StaticResource ToolBar_OuterBorder}" BorderThickness="1" Background="{StaticResource ToolBar_InnerBackground}" Grid.ColumnSpan="2" CornerRadius="0" HorizontalAlignment="Stretch" Grid.RowSpan="2">

                            <Border BorderBrush="{StaticResource ToolBar_InnerBorder}" BorderThickness="1" CornerRadius="0"/>

                        </Border>

                        <Border x:Name="BindingBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="0,0,0,0" Grid.Column="1" />

                        <Grid Visibility="{TemplateBinding GripVisibility}">

                            <Grid x:Name="GripOrnamentH" Visibility="Visible">

                                <!--<Path Data="M0,12 L2,12 2,14 0,14 0,12 z M0,8 L2,8 2,10 0,10 0,8 z M0,4 L2,4 2,6 0,6 0,4 z M0,0 L2,0 2,2 0,2 0,0 z" Fill="{StaticResource ToolBar_OuterGripOrnament}" HorizontalAlignment="Left" Height="14" Margin="5,1,0,0" Stretch="Fill" VerticalAlignment="Center" Width="2"/>

                <Path Data="M0,12 L2,12 2,14 0,14 0,12 z M0,8 L2,8 2,10 0,10 0,8 z M0,4 L2,4 2,6 0,6 0,4 z M0,0 L2,0 2,2 0,2 0,0 z" Fill="{StaticResource ToolBar_InnerGripOrnament}" HorizontalAlignment="Left" Height="14" Margin="4.4,0.4,0,0" Stretch="Fill" VerticalAlignment="Center" Width="2"/>-->

                            </Grid>

                            <Grid x:Name="GripOrnamentV" Visibility="Collapsed">

                                <Path Data="M12,0 L12,2 14,2 14,0 12,0 z M8,0 L8,2 10,2 10,0 8,0 z M4,0 L4,2 6,2 6,0 4,0 z M0,0 L0,2 2,2 2,0 0,0 z" Fill="{StaticResource ToolBar_OuterGripOrnament}" HorizontalAlignment="Center" Height="2" Margin="1,1,0,0" Stretch="Fill" VerticalAlignment="Center" Width="14"/>

                                <Path Data="M12,0 L12,2 14,2 14,0 12,0 z M8,0 L8,2 10,2 10,0 8,0 z M4,0 L4,2 6,2 6,0 4,0 z M0,0 L0,2 2,2 2,0 0,0 z" Fill="{StaticResource ToolBar_InnerGripOrnament}" HorizontalAlignment="Center" Height="2" Margin="0.4,0.4,0,0" Stretch="Fill" VerticalAlignment="Center" Width="14"/>

                            </Grid>

                        </Grid>

                        <StackPanel x:Name="PART_StripPanel" Grid.Column="1" HorizontalAlignment="Left" Margin="0,1,4,1" Orientation="Horizontal"/>

                    </Grid>

                </ControlTemplate>

            </Setter.Value>

        </Setter>

    </Style>

 

    <telerik:ToolBarContainerStyleSelector x:Key="ToolBarContainerStyleSelector">

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarSeparator}" TypeName="RadToolBarSeparator"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarTextBlock}" TypeName="TextBlock"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarTextBox}" TypeName="TextBox"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarButton}" TypeName="Button"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarToggleButton}" TypeName="ToggleButton"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarCheckBox}" TypeName="CheckBox"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadioButton}" TypeName="RadioButton"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadButton}" TypeName="RadButton"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadToggleButton}" TypeName="RadToggleButton"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadRadioButton}" TypeName="RadRadioButton"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadDropDownButton}" TypeName="RadDropDownButton"/>

        <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadSplitButton}" TypeName="RadSplitButton"/>

    </telerik:ToolBarContainerStyleSelector>

    In commenting this line, we have lost our defined style.  How can we correct it ?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 08 Aug 2011, 02:30 PM
Hi Sébastien Chicoine,

Can you try setting the ItemContainerStyleSelector property in the RadToolBar style like so:
<Style x:Key="RadToolBarStyle1" TargetType="telerik:RadToolBar">
    <Setter Property="ItemContainerStyleSelector">
        <Setter.Value>
            <telerik:ToolBarContainerStyleSelector>
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarSeparator}" TypeName="RadToolBarSeparator" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarTextBlock}" TypeName="TextBlock" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarTextBox}" TypeName="TextBox" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarButton}" TypeName="Button" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarToggleButton}" TypeName="ToggleButton" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarCheckBox}" TypeName="CheckBox" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadioButton}" TypeName="RadioButton" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadButton}" TypeName="RadButton" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadToggleButton}" TypeName="RadToggleButton" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadRadioButton}" TypeName="RadRadioButton" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadDropDownButton}" TypeName="RadDropDownButton" />
                <telerik:ToolBarContainerStyle ContainerStyle="{StaticResource ToolBarRadSplitButton}" TypeName="RadSplitButton" />
            </telerik:ToolBarContainerStyleSelector>
        </Setter.Value>
    </Setter>
    <Setter Property="MinWidth" Value="25" />
    <Setter Property="Template">
        ...
    </Setter>
</Style>

Please give this a try and let me know if it works for you?

All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Sébastien Chicoine
Top achievements
Rank 1
answered on 08 Aug 2011, 04:22 PM
It works,

Thanks a lot !
Tags
ToolBar
Asked by
Sébastien Chicoine
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Sébastien Chicoine
Top achievements
Rank 1
Share this question
or