标签: expander

折叠所有内容时隐藏扩展器

我有一个WPF Datagrid,它有一个Collection View Source,上面有3个级别的分组.

我已经设置了datagrid样式以使用3个扩展器,使它看起来像这样:

Level 1 Expander
<content>
    Level 2 Expander
    <content>
        Level 3 Expander
        <content>
Run Code Online (Sandbox Code Playgroud)

2级和1级只是组的标题

我有第二个控件允许用户显示和隐藏3级项目,这些项目通过将Level 3扩展器绑定到后面对象中的布尔"IsVisible"属性来工作.

       <!--  Style for groups under the top level. this is the style for how a sample is displayed  -->
        <GroupStyle>
            <GroupStyle.ContainerStyle>
                <Style TargetType="{x:Type GroupItem}">
                    <Setter Property="Margin" Value="0,0,0,0" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type GroupItem}">

                                <!--  The parent control that determines whether or not an item needs to be displayed. This holds all of the sub controls displayed for a sample …
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml expander

10
推荐指数
1
解决办法
1397
查看次数

WPF扩展器按钮样式,因此它在Expander标头内

我正在使用Expander控件并设置了标题,如下图所示:

http://www.hughgrice.com/Expander.jpg

Expander我遇到的问题是我希望扩展器按钮包含在标题中,以便标题模板末尾的行与内容对齐,即我最终想要得到类似于下图的内容:

http://www.hughgrice.com/Expander.gif

提前致谢.

silverlight wpf xaml expander

9
推荐指数
2
解决办法
1万
查看次数

右侧的扩展按钮:怎么做?

扩展器在右侧怎么样?

我想将Expander按钮放在标签的右侧.这该怎么做?

wpf xaml expander controltemplates wpf-controls

9
推荐指数
2
解决办法
2万
查看次数

WPF - 如何在任何时候只扩展一个扩展器

我有一个带有一组扩展器的StackPanel,如何设置它以便任何时候只展开扩展器?

干杯

AW

wpf expander stackpanel

8
推荐指数
1
解决办法
8986
查看次数

在Expander上禁用TabStop

我设置IsTabStopFalse,但Tab仍导航到扩展.

有什么想法我做错了什么?

<Expander Header="Data" IsTabStop="False">
    <Border Background="White" BorderThickness="0"/>
</Expander>
Run Code Online (Sandbox Code Playgroud)

wpf expander tabstop

8
推荐指数
1
解决办法
2748
查看次数

如何将Expander ToggleButton放在右边

默认情况下,扩展器有一个左对齐的切换按钮,但在我的WPF应用程序中,我希望在没有Expression Blend帮助的情况下切换标题右侧的按钮.只是简单的XAML和/或C#.我的扩展器包含一个垂直方向的stackpanel,它有标签作为它的子.

我去了它的部分,但在这里它说"Expander控件没有任何命名的部分".

我在这里找到了一个例子.但它会覆盖默认的Expander Style.

我认为附加的图像应该表达我想要的东西.怎么做.任何链接都会有所帮助.

在此输入图像描述

c# wpf expander

8
推荐指数
2
解决办法
9849
查看次数

Expander的默认ControlTemplate

有人(可能使用Blend)为WPF Expander提供了一个有效的默认ControlTemplate吗?我想做一些细微的修改,但似乎我找不到有效模板的来源.

提前致谢.

c# wpf expander controltemplate

8
推荐指数
1
解决办法
7503
查看次数

带有嵌套扩展器的ListView不会折叠

这个问题与其他未回答的问题相同.

扩展扩展外ListView的增长,使空间的扩展内容,但在扩展随后倒塌的观点并不强制ListView控件来调整.

减少代码,注释后:

<!--<StackPanel>-->
<ItemsControl>

  <!-- ParameterGroupView -->
  <Border BorderBrush="Brown" BorderThickness="1" CornerRadius="4" Padding="4">
    <ListView HorizontalContentAlignment="Stretch">
      <Expander Header="Expander A" IsExpanded="False">
        <ListView HorizontalContentAlignment="Stretch">

          <!-- TextView -->
          <TextBlock >Content A</TextBlock>
          <TextBlock >Content B</TextBlock>

        </ListView>
      </Expander>

    </ListView>
  </Border>

</ItemsControl>
<!--</StackPanel>-->
Run Code Online (Sandbox Code Playgroud)

我在ItemsControlStackPanel中ParameterGroupView,因为实际上有很多ParameterGroupView条目.交换到StackPanel不会改变行为.

删除边界不会影响行为,但让它只显示一个ParameterGroupView的行为.

可以有很多扩展外部分的ListView扩展可以让内内许多实体的ListView.

外部ListViewExpander是替换一个TreeView,它曾经有一个可折叠节点列表,但TreeView内部使用了网格,意味着TextView项目被横向压缩,就像删除了以下的一样: …

wpf listview expander

7
推荐指数
1
解决办法
2983
查看次数

WPF - 向左展开窗口

我有一个带可扩展面板(via Expander)的WPF窗口.面板位于窗口的左侧,展开后窗口会增大以适应内容.

默认情况下,窗口固定在左上角,因此我的窗口向右移动.我希望窗户向左侧增长.

我试图在Window.SizeChanged事件中做以下事情:

private void onWindowSizeChanged(object sender, SizeChangedEventArgs e)
{
    Left -= (e.NewSize.Width - e.PreviousSize.Width)
}
Run Code Online (Sandbox Code Playgroud)

它有效,但增长不稳定,我想找到一个更顺畅的解决方案.

wpf resize expander

7
推荐指数
1
解决办法
3461
查看次数

折叠所有展开器并默认展开其中一个展开器

我有多个扩展器,我正在寻找一种方法来折叠所有其他扩展器,当其中一个扩展时.我在这里找到了这个解决方案

XAML:

<StackPanel Name="StackPanel1">
    <StackPanel.Resources>
        <local:ExpanderToBooleanConverter x:Key="ExpanderToBooleanConverter" />
    </StackPanel.Resources>
    <Expander Header="Expander 1"
        IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=1}">
        <TextBlock>Expander 1</TextBlock>
    </Expander>
    <Expander Header="Expander 2"
        IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=2}">
        <TextBlock>Expander 2</TextBlock>
    </Expander>
    <Expander Header="Expander 3"
        IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=3}">
        <TextBlock>Expander 3</TextBlock>
    </Expander>
    <Expander Header="Expander 4"
        IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=4}">
        <TextBlock>Expander 4</TextBlock>
    </Expander>
</StackPanel>
Run Code Online (Sandbox Code Playgroud)

转换器:

public class ExpanderToBooleanConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return (value …
Run Code Online (Sandbox Code Playgroud)

c# wpf expander mvvm

6
推荐指数
1
解决办法
4241
查看次数