WPF扩展器没有扩展

时间:2016-05-03 15:28:46

标签: c# wpf

我想在不使用WPF工具包的情况下创建一个类似WPF手风琴的自定义控件...经过一些搜索后,似乎最好的方法是使用Expander ...所以我想看看是否我可以获得某种基本功能,例如,在向上展开以显示某些内容时展开一行,然后让它折叠并隐藏该内容。看起来它应该是非常直接但我的扩展器永远不会扩展。这是我的基本例子:

library(ggplot2)
ggplot(df, aes(x=Age, y=GPP)) + 
  geom_point()+
  theme(panel.grid = element_blank(),
        element_text(hjust=seq(from=0,to=1,length.out=6)),
        axis.text.y = element_text(margin=margin(5,5,10,5,"pt")))

1 个答案:

答案 0 :(得分:3)

更新您的RowDefinitions。目前,Row所在的Expander被硬编码为Height为24. Auto

<Grid.RowDefinitions>
    <RowDefinition Height="30"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="1*"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>