Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Rotating header
posted

Hi,

 I try to rotate field header.

            <Style TargetType="{x:Type igDP:LabelPresenter}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="igDP:LabelPresenter">
                            <ContentPresenter>                               
                                <ContentPresenter.LayoutTransform>
                                    <RotateTransform Angle="-45" />
                                </ContentPresenter.LayoutTransform>
                            </ContentPresenter>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

 

The header ist rotated but the text is cut. Not heigt enough.

 Any idea?

Regards,
Ladislav


 

  • 69686
    posted

     Hello Ladislav,

     You can modify the size of the rotating header by creating a style for it, like you have done -- for the rotation. All you need to do is add another Setter for the TextBlock.Width and TextBlock.Height properties of the header -- something like this:

     

    <Style TargetType="{x:Type igDP:LabelPresenter}">
                <Setter Property="TextBlock.Height" Value="70"/>
                <Setter Property="TextBlock.Width" Value="70"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="igDP:LabelPresenter">
                            <ContentPresenter>
                                <ContentPresenter.LayoutTransform>
                                    <RotateTransform Angle="-45" />
                                </ContentPresenter.LayoutTransform>
                            </ContentPresenter>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>