Problem when extracting Silverlight resources

2 posts, 0 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 05 Nov 2012 Link to this post

    I have been using JustDecompile to extract resource files from the RadControls for Silverlight DLLs. Specifically, I wanted to get the GridViewRowTemplate from the Telerik.Windows.Themes.Windows8.dll file. The result that I get in JustDecompile is what I have pasted under "Example 1" below. As you can see, the SelectiveScrollingGrid object is empty and has empty and invalid values for its ColumnDefinitions and RowDefinitions properties. It also has this x:_UnknownContent property which I suppose is something that JustDecompile has generated. This is obviously not the real template, the entire contents of the SelectiveScrollingGrid is missing. So, there has to be a problem with the way JustDecompile extracts the resources, right?

    By the way, the "real" template, as found in the folder \Themes.Implicit\Windows8\Themes\Telerik.Windows.Controls.GridView.xaml under the unzipped RadControls folder is as I have pasted under "Example 2". As you can see, there is a whole lot more to it than what was extracted using JustDecompile.

    The version of JustDecompile that I am using is Version 2012.3.1016.8.

    Example 1:
    <ControlTemplate x:Key="GridViewRowTemplate"
                     TargetType="grid:GridViewRow">
        <Border BorderThickness="{TemplateBinding BorderThickness}"
                BorderBrush="{TemplateBinding BorderBrush}">
            <Border.VisualStateGroups>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="SelectionStates">
                    <VisualState x:Name="Unselected"/>
                    <VisualState x:Name="SelectedUnfocused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                           Storyboard.TargetName="Background_Over"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Over"
                                                           Storyboard.TargetProperty="Fill">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                                        Value="{StaticResource AccentBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation To="0.1"
                                             Duration="0"
                                             Storyboard.TargetName="Background_Over"
                                             Storyboard.TargetProperty="(UIElement.Opacity)"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                           Storyboard.TargetName="Background_Over"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Selected">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                           Storyboard.TargetName="Background_Selected"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ValueStates">
                    <VisualState x:Name="RowValid"/>
                    <VisualState x:Name="RowInvalid">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Invalid"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ErrorIndicator"
                                                           Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="EditStates">
                    <VisualState x:Name="ReadOnlyMode"/>
                    <VisualState x:Name="EditMode">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditIndicator"
                                                           Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </Border.VisualStateGroups>
            <grid:SelectiveScrollingGrid x:Name="grid"
                                         Grid.ColumnDefinitions=" "
                                         Grid.RowDefinitions=" "
                                         x:_UnknownContent=" "/>
        </Border>
    </ControlTemplate>


    Example 2:
    <ControlTemplate x:Key="GridViewRowTemplate"
                     TargetType="grid:GridViewRow">
        <Border BorderThickness="{TemplateBinding BorderThickness}"
                BorderBrush="{TemplateBinding BorderBrush}">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused" />
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NavigatorIndicator"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="SelectionStates">
                    <VisualState x:Name="Unselected" />
                    <VisualState x:Name="SelectedUnfocused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                           Storyboard.TargetName="Background_Over"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Over"
                                                           Storyboard.TargetProperty="Fill">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                                        Value="{StaticResource AccentBrush}" />
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation To="0.1"
                                             Duration="0"
                                             Storyboard.TargetName="Background_Over"
                                             Storyboard.TargetProperty="(UIElement.Opacity)" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                           Storyboard.TargetName="Background_Over"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Selected">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                           Storyboard.TargetName="Background_Selected"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ValueStates">
                    <VisualState x:Name="RowValid" />
                    <VisualState x:Name="RowInvalid">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Invalid"
                                                           Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ErrorIndicator"
                                                           Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="EditStates">
                    <VisualState x:Name="ReadOnlyMode" />
                    <VisualState x:Name="EditMode">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditIndicator"
                                                           Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <grid:SelectiveScrollingGrid x:Name="grid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Border x:Name="SelectionBackground"
                        Grid.Column="2"
                        Grid.ColumnSpan="2"
                        Background="{TemplateBinding Background}"
                        Margin="{TemplateBinding Margin}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        Padding="{TemplateBinding Padding}"
                        grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                        HorizontalAlignment="{Binding RenderHorizontalAlignment, RelativeSource={RelativeSource TemplatedParent}}"
                        MinWidth="{Binding RenderWidth, RelativeSource={RelativeSource TemplatedParent}}" />
                <Rectangle x:Name="Background_Over"
                           Fill="{StaticResource StrongBrush}"
                           Opacity="0.1"
                           Grid.ColumnSpan="4"
                           Visibility="Collapsed"
                           grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                           HorizontalAlignment="{Binding RenderHorizontalAlignment, RelativeSource={RelativeSource TemplatedParent}}"
                           MinWidth="{Binding RenderWidth, RelativeSource={RelativeSource TemplatedParent}}" />
                <Rectangle x:Name="Background_Selected"
                           Fill="{StaticResource BasicBrush}"
                           Margin="0,0,0,1"
                           Grid.ColumnSpan="4"
                           Visibility="Collapsed"
                           grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                           HorizontalAlignment="{Binding RenderHorizontalAlignment, RelativeSource={RelativeSource TemplatedParent}}"
                           MinWidth="{Binding RenderWidth, RelativeSource={RelativeSource TemplatedParent}}" />
                <Rectangle x:Name="Background_Invalid"
                           Stroke="{StaticResource ValidationBrush}"
                           Fill="{StaticResource MainBrush}"
                           StrokeThickness="1"
                           Grid.ColumnSpan="4"
                           Visibility="Collapsed"
                           grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                           HorizontalAlignment="{Binding RenderHorizontalAlignment, RelativeSource={RelativeSource TemplatedParent}}"
                           MinWidth="{Binding RenderWidth, RelativeSource={RelativeSource TemplatedParent}}" />
                <controls:GridViewToggleButton Grid.Column="2"
                                               x:Name="PART_HierarchyExpandButton"
                                               Width="25"
                                               grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                                               Opacity="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToOpacityConverter}}"
                                               IsHitTestVisible="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}}"
                                               Visibility="{Binding HasHierarchy, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"
                                               IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                               IsTabStop="{TemplateBinding IsTabStop}" />
                <Border Grid.Column="2"
                        grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                        Visibility="{Binding HasHierarchy, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" />
                <grid:DataCellsPresenter Grid.Column="3"
                                         x:Name="PART_DataCellsPresenter" />
                <Border x:Name="PART_RowBorder"
                        BorderBrush="{TemplateBinding HorizontalGridLinesBrush}"
                        BorderThickness="{Binding HorizontalGridLinesWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource GridLineWidthToThicknessConverter}, ConverterParameter=Bottom}"
                        Grid.ColumnSpan="4"
                        Grid.Column="1"
                        Grid.RowSpan="4"
                        VerticalAlignment="Bottom"
                        grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                        HorizontalAlignment="{Binding RenderHorizontalAlignment, RelativeSource={RelativeSource TemplatedParent}}"
                        MinWidth="{Binding RenderWidth, RelativeSource={RelativeSource TemplatedParent}}" />
                <Border Grid.Column="2"
                        Grid.Row="2"
                        Grid.ColumnSpan="2"
                        MaxWidth="30000"
                        HorizontalAlignment="{Binding RenderHorizontalAlignment, RelativeSource={RelativeSource TemplatedParent}}"
                        grid:SelectiveScrollingGrid.SelectiveScrollingClip="True">
                    <ContentPresenter x:Name="PART_HierarchyChildPresenter"
                                      grid:SelectiveScrollingGrid.SelectiveScrollingClip="True"
                                      Visibility="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" />
                </Border>
                <grid:DetailsPresenter x:Name="PART_DetailsPresenter"
                                       Grid.Column="2"
                                       Grid.ColumnSpan="2"
                                       Grid.Row="1"
                                       DetailsProvider="{TemplateBinding DetailsProvider}"
                                       MaxWidth="30000"
                                       HorizontalAlignment="{Binding RenderHorizontalAlignment, RelativeSource={RelativeSource TemplatedParent}}" />
                <Border x:Name="PART_IndicatorPresenter"
                        Width="25"
                        VerticalAlignment="Stretch"
                        Visibility="{TemplateBinding RowIndicatorVisibility}"
                        grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
                        Grid.RowSpan="3"
                        Background="{StaticResource MainBrush}"
                        BorderBrush="{StaticResource BasicBrush}"
                        BorderThickness="0,0,1,0">
                    <Grid>
                        <Grid x:Name="NavigatorIndicator"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              Width="9"
                              Height="9"
                              Visibility="Collapsed">
                            <Path x:Name="plus"
                                  Stretch="Fill"
                                  Width="8"
                                  Height="4"
                                  Data="M0,0 L8,2.3841858E-07 L4,4 z"
                                  RenderTransformOrigin="0.5,0.5"
                                  Fill="{StaticResource AccentBrush}"
                                  StrokeThickness="{TemplateBinding BorderThickness}"
                                  Margin="{TemplateBinding Padding}">
                                <Path.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleY="-1" />
                                        <SkewTransform />
                                        <RotateTransform Angle="90" />
                                        <TranslateTransform X="9.5006054579016563E-08"
                                                            Y="-4.6599587300022449E-08" />
                                    </TransformGroup>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                        <Border x:Name="EditIndicator"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Width="12"
                                Height="10"
                                Visibility="Collapsed"
                                Background="{StaticResource MainBrush}"
                                BorderBrush="{StaticResource StrongBrush}"
                                BorderThickness="1">
                            <Path Fill="{StaticResource StrongBrush}"
                                  Stretch="Fill"
                                  Data="M3,2 L4,2 L5,2 L6,2 L6,3 L5,3 L5,4 L5,5 L5,6 L5,7 L6,7 L6,8 L5,8 L4,8 L3,8 L3,7 L4,7 L4,6 L4,5 L4,4 L4,3 L3,3 z"
                                  HorizontalAlignment="Left"
                                  Margin="1,1,0,1"
                                  Width="3"
                                  Height="6" />
                        </Border>
                        <Grid x:Name="ErrorIndicator"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              Visibility="Collapsed">
                            <Ellipse Fill="{StaticResource MainBrush}"
                                     Width="16"
                                     Height="16"
                                     Stroke="{StaticResource ValidationBrush}" />
                            <Path Data="M1.0000001,8 C1.5522848,8 2.0000002,8.4477148 2.0000002,9 C2.0000002,9.5522842 1.5522848,10 1.0000001,10 C0.4477154,10 1.527369E-07,9.5522842 1.4901161E-07,9 C1.527369E-07,8.4477148 0.4477154,8 1.0000001,8 z M0,0 L2,0 L2,7 L0,7 z"
                                  Fill="{StaticResource ValidationBrush}"
                                  Width="2"
                                  Height="10"
                                  Stretch="Fill" />
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         Placement="Bottom"
                                         Content="{TemplateBinding Errors}"
                                         Template="{StaticResource GridViewRow_ValidationToolTipTemplate}"></ToolTip>
                            </ToolTipService.ToolTip>
                        </Grid>
                        <Border x:Name="PART_RowResizer"
                                Background="Transparent"
                                Height="4"
                                VerticalAlignment="Bottom"
                                Cursor="SizeNS" />
                    </Grid>
                </Border>
                <grid:IndentPresenter x:Name="PART_IndentPresenter"
                                      IndentLevel="{TemplateBinding IndentLevel}"
                                      Grid.Column="1"
                                      Grid.RowSpan="4"
                                      grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" />
            </grid:SelectiveScrollingGrid>
        </Border>
    </ControlTemplate>
  2. Nikolay G Rusev
    Admin
    Nikolay G Rusev avatar
    44 posts

    Posted 06 Nov 2012 Link to this post

    Hi Henrik,

     Thank you for pointing out this problem. We've logged it and it will surely be fixed in some of our forthcoming releases.

    Greetings,
    Nikolay G Rusev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top