正如标题所说,我的工作基于this 这有效!问题是我无法解决这些问题:
listviewCode是:
<ListView x:Name="lvPPtab1" Grid.Row="2" FontSize="12" Background="{x:Null}" BorderBrush="Gainsboro" BorderThickness="5" Margin="10,12.2,10,8.4" VerticalAlignment="Stretch" PreviewMouseLeftButtonDown="ListBox_PreviewMouseLeftButtonDown" SelectionChanged="ListView_SelectionChanged">
<ListView.Effect>
<DropShadowEffect ShadowDepth="4" Direction="330" Color="Black" Opacity="0.5" BlurRadius="4"/>
</ListView.Effect>
<ListView.ItemsPanel >
<ItemsPanelTemplate >
<WrapPanel Orientation="Horizontal" Width="250" Background="{x:Null}" VerticalAlignment="Top"></WrapPanel>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
它可以通过编程方式填充项目(像列表视图一样)或者使用网格(像数据网格一样)。在这种情况下,我专注于数据网格的情况。
ObservableCollection<String> obc = new ObservableCollection<string>();
obc.Add("AAAA");
obc.Add("BBB");
GridView myGridView = new GridView();
myGridView.AllowsColumnReorder = true;
GridViewColumn gvc = new GridViewColumn();
//gvc1.DisplayMemberBinding = new Binding("ColumnOneHeader");
gvc.Header = Languages.Word(eWords.Description);
myGridView.Columns.Add(gvc);
lvPPtab1.View = myGridView;
lvPPtab1.Items.Add("AAAA");
lvPPtab1.Items.Add("BBB");
lvPPtab1.Background = Brushes.Transparent;
lvPPtab1.Foreground = Brushes.Gainsboro;
我需要模拟的是类似于在显示图像或名称时在资源管理器中发生的事情