[UWA] [XAML] [英] [UWA][XAML]

查看:57
本文介绍了[UWA] [XAML]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在Generic.xaml中定义的GridViewHeaderItem样式存在问题


如果我在我的上面设置了Padding标题它不会移动矩形...为什么在矩形的边距上的填充上没有TemplateBinding?这对我的pov没有任何意义..



谢谢。


<! -  Windows.UI.Xaml.Controls.GridViewHeaderItem的默认样式 - > 
< Style TargetType =" GridViewHeaderItem">
< Setter Property =" FontFamily" Value =" {ThemeResource ContentControlThemeFontFamily}" />
< Setter Property =" FontSize" Value =" {ThemeResource GridViewHeaderItemThemeFontSize}" />
< Setter Property =" Background"值= QUOT;透明" />
< Setter Property =" Margin"值= QUOT; 0,0,0,4" />
< Setter Property =" Padding"值= QUOT; 12,8,12,0" />
< Setter Property =" Horizo​​ntalContentAlignment"值= QUOT;左" />
< Setter Property =" VerticalContentAlignment"值= QUOT;陀螺" />
< Setter Property =" MinHeight" Value =" {ThemeResource GridViewHeaderItemMinHeight}" />
< Setter Property =" UseSystemFocusVisuals"值= QUOT;真" />
< Setter Property =" Template">
< Setter.Value>
< ControlTemplate TargetType =" GridViewHeaderItem">
< StackPanel Background =" {TemplateBinding Background}"
BorderBrush =" {TemplateBinding BorderBrush}"
BorderThickness =" {TemplateBinding BorderThickness}">
< ContentPresenter x:Name =" ContentPresenter"
Margin =" {TemplateBinding Padding}"
Content =" {TemplateBinding Content}"
ContentTemplate =" {TemplateBinding ContentTemplate}"
ContentTransitions =" {TemplateBinding ContentTransitions}"
Horizo​​ntalContentAlignment =" {TemplateBinding Horizo​​ntalContentAlignment}"
VerticalContentAlignment =" {TemplateBinding VerticalContentAlignment}" />
< Rectangle Stroke =" {ThemeResource SystemControlForegroundBaseLowBrush}"
StrokeThickness =" 0.5"
Height =" 1"
VerticalAlignment =" Bottom"
Horizo​​ntalAlignment =" Stretch"
Margin =" 12,8,12,0" />
< / StackPanel>
< / ControlTemplate>
< /Setter.Value>
< / Setter>
< / Style>

解决方案

< blockquote>

您好,


感谢您在此处发帖。


根据您的问题,我将帮助您转到通用Windows开发论坛更好的支持。


希望你能理解。


May


Hi,

I have an issue with GridViewHeaderItem Style defined in the Generic.xaml

If I set the Padding on my Header it does not move the Rectangle... Why is there no TemplateBinding on Padding on the Margin of the Rectangle?? This does not make any sense from my pov..

Thanks.

    <!-- Default style for Windows.UI.Xaml.Controls.GridViewHeaderItem -->
    <Style TargetType="GridViewHeaderItem">
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource GridViewHeaderItemThemeFontSize}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Margin" Value="0,0,0,4"/>
        <Setter Property="Padding" Value="12,8,12,0"/>
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="MinHeight" Value="{ThemeResource GridViewHeaderItemMinHeight}"/>
        <Setter Property="UseSystemFocusVisuals" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridViewHeaderItem">
                    <StackPanel Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentPresenter x:Name="ContentPresenter"
                                          Margin="{TemplateBinding Padding}"
                                          Content="{TemplateBinding Content}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          ContentTransitions="{TemplateBinding ContentTransitions}"
                                          HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        <Rectangle Stroke="{ThemeResource SystemControlForegroundBaseLowBrush}"
                                   StrokeThickness="0.5"
                                   Height="1"
                                   VerticalAlignment="Bottom"
                                   HorizontalAlignment="Stretch"
                                   Margin="12,8,12,0"/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

解决方案

Hi,

Thanks for posting here.

Based on your issue, I will help you move to universal windows development forum for a better support.

Hope you can understand.

May


这篇关于[UWA] [XAML]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆