0

我有一个列表视图,并且希望在按下按钮时在弹出窗口中显示更多信息。无论如何,我的列表视图看起来像:

<ListView Name="TableListView">
  <ListView.View>
    <GridView>
      <GridViewColumn  Width="50"
                       Header="ID">
        <GridViewColumn.CellTemplate>
          <DataTemplate>
            <Label Content="{Binding Id}"
                   HorizontalAlignment="Center" />
          </DataTemplate>
        </GridViewColumn.CellTemplate>
      </GridViewColumn>

      <!-- I am having trouble with this column! -->
      <GridViewColumn  Width="50"
                       Header="ID">
        <GridViewColumn.CellTemplate>
          <DataTemplate>
            <StackPanel>
              <Button Content="Click to show more Info">
                <Button.Triggers>
                  <Trigger Property="IsMouseOver"
                           Value="True">
                    <Setter TargetName="PopupSelectFile"
                            Property="IsOpen"
                            Value="True">
                    </Setter>
                  </Trigger>
                </Button.Triggers>
              </Button>
              <Popup x:Name="PopupSelectFile">
                <Button Width="100"
                        Height="100"></Button>
              </Popup>
            </StackPanel>
          </DataTemplate>
        </GridViewColumn.CellTemplate>
      </GridViewColumn>

    </GridView>
  </ListView.View>
</ListView>

基本上我想在单击第二列上的按钮时显示一个弹出窗口(PopupSelectFile)。

4

1 回答 1

2
<ToggleButton x:Name="theButton">
    ...
</ToggleButton>
<Popup IsOpen="{Binding IsChecked, ElementName=theButton">
    ...
</Popup>
于 2013-04-17T19:22:52.787 回答