删除边距按钮ContentDialog Windows 10 Mobile - XAML [英] Remove Margin Button ContentDialog Windows 10 Mobile - XAML

查看:179
本文介绍了删除边距按钮ContentDialog Windows 10 Mobile - XAML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的ContentDialog中在焦点任何元素,键入TextBox,键盘出现。当键盘出现时,有一个大的边缘以上(所以20-30像素也许)。此空间与为主按钮和辅助按钮分配的空间高度相同。如果有这个差距,我的内容有一个滚动条,我不想要它。我有空间足以显示我的对话框的所有内容,如果删除此margin / padding当然。

In my ContentDialog. On focus any element, type TextBox, the keyboard appear. When Keyboard appear, have a big margin above( so 20-30 px maybe). This space is the same height of the space allocated for Primary and Secondary Buttons. If have this margin, my content have a scrollbar and I do not want it. I have space sufficient to show all content of my dialog if remove this margin/padding of course.

此主题与以下内容相关: ContentDialog Windows 10 Mobile XAML - FullScreen - Padding

This topic is related with: ContentDialog Windows 10 Mobile XAML - FullScreen - Padding

<StackPanel Orientation="Horizontal">


             <TextBox x:Name="txtUser" IsSpellCheckEnabled="False"
             Background="Black" Foreground="Red  BorderBrush="Red" BorderThickness="1"
             PlaceholderText="Digit your username"
             GotFocus="txtUser_GotFocus" Style="{StaticResource TextBoxStyle}" 
             TextChanged="txtUser_TextChanged"
             />

            <Button x:Name="MakeOff" 
            Height="32" BorderThickness="1" 
            HorizontalAlignment="Center"
            Foreground="Red" Background="Black"
            Style="{StaticResource ButtonStyle}"
            Margin="0">

            <HyperlinkButton
            Height="32" BorderThickness="1" 
            HorizontalAlignment="Center"
            Foreground="Red" Background="Black"
            Margin="0"
            NavigateUri="www.google.pt"
            Style="{StaticResource HyperLinkButtonStyleMobile}"
            Content="Register">
                <HyperlinkButton.ContentTemplate>
                    <DataTemplate>
                    <TextBlock Text="{Binding}" />
                    </DataTemplate>
                </HyperlinkButton.ContentTemplate>
            </HyperlinkButton>

            <Button 
            Height="32" BorderThickness="1" 
            HorizontalAlignment="Center"
            Foreground="Red" Background="Black"
            Style="{StaticResource ButtonStyle}"
            Margin="0">

            <HyperlinkButton x:Name="btnRegisterTwo"
            Height="32" BorderThickness="1" 
            HorizontalAlignment="Center"
            Foreground="Red" Background="Black"
            Margin="0"
            NavigateUri="www.google.pt"
            Style="{StaticResource HyperLinkButtonStyleMobile}"
            Content="Register">
                <HyperlinkButton.ContentTemplate>
                    <DataTemplate>
                    <TextBlock Text="{Binding}" />
                    </DataTemplate>
                </HyperlinkButton.ContentTemplate>
            </HyperlinkButton>

          <Button x:Name="MakeOffThree" 
            Height="32" BorderThickness="1" 
            HorizontalAlignment="Center"
            Foreground="Red" Background="Black"
            Style="{StaticResource ButtonStyle}"
            Margin="0">
          </StackPanel>
      </Grid>

有人帮助删除这个?

感谢

推荐答案

有趣的是,风格内的 ContentScrollViewer 运行时的高度,并且hack将从 ScrollViewer 中删除​​ x:Name

Interestingly, the ContentScrollViewer inside the style is given a fixed height during run-time, and a hack is to remove this x:Name from the ScrollViewer.

<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" ZoomMode="Disabled" Margin="{ThemeResource ContentDialogContentScrollViewerMargin}" IsTabStop="False">

此外,您还需要添加 RowDefinitions 返回到样式中的根面板 LayoutRoot

Also, you will need to add the RowDefinitions back to the root panel LayoutRoot in the style.

<Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

这篇关于删除边距按钮ContentDialog Windows 10 Mobile - XAML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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