zoukankan      html  css  js  c++  java
  • 根据Expander的IsExpanded属性值的变化动态设计Control的size

    简要说明:

    当Expander 的IsExpanded属性为“True” 时给控件设个尺寸(此处为高度),当为“False”时给控件设另外一个值。

    知识点:数据绑定、Style和Trigger

          <Grid>
            <Grid.RowDefinitions>
                <RowDefinition>
                    <RowDefinition.Style>
                        <Style TargetType="RowDefinition">
                            <Setter Property="Height" Value="25" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding ElementName=testExpander,Path=IsExpanded}" Value="True">
                                    <Setter Property="Height" Value="205" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </RowDefinition.Style>
                </RowDefinition>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
                
            <Expander Header="Haha"  x:Name="testExpander" />
            <StackPanel Grid.Row="1" >
                <TabControl>
                    <TabItem Header="HaHaTabItem" >
                        <ListBox>
                            <ListBoxItem Content="Blue" />
                            <ListBoxItem Content="Black" />
                            <ListBoxItem Content="Red" />
                        </ListBox>
                     </TabItem>
                </TabControl>
            </StackPanel>
        </Grid>

  • 相关阅读:
    php网站请求返回结果被加入恶意代码片段
    php tp5 的index.php 被改成首页静态页面内容
    gitee https 方式每次都要输入密码的解决
    linux 下 php执行 exec 无反应 返回值为空
    layerconfirm 右上角关闭事件等于按钮2
    微信小程序公共方法创建与调用
    php curl 转为 x-www-form-urlencoded 方式
    php 加载 zip 文件
    小程序语音播报
    mysql命令行操作-将查询结果导出到文件
  • 原文地址:https://www.cnblogs.com/NaughtyCat/p/5621647.html
Copyright © 2011-2022 走看看