2009-11-26 69 views
0

我想添加一個GridViewColumn到一個ListView,它位於另一個Windows屏幕(Parent)的UserControl中。UserControl(從另一個用戶控件添加列表視圖GridViewColumn)

例子:

<UserControl x:Class="ListViewUserControl" 
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      Height="100" Width="300"> 
    <Canvas> 
     <StackPanel Height="100" Width="300" Name="listViewHolder"> 
      <ListView Name="LstView"/> 
     </StackPanel> 
    </Canvas> 
</UserControl> 

我想使用Windows這個用戶控制。

如何更改ListView樣式,ItemContainerStyle或添加GridViewColumn?

<Window x:Class="WpfApplicationListView.Window2" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     Title="Window2" Height="470" Width="882"> 
    <Canvas> 
     <my1:ListViewNavigation Name="navCtrl" 
           xmlns:my1="clr-namespace:UsrControls;assembly=UsrControls" 
           Canvas.Left="0" Canvas.Top="0" Height="233" Width="493"> 
     </my1:ListViewNavigation> 
    </Canvas> 
</Window> 

請讓我知道是否有任何其他方式來設計這種情況。

問候,

Jegan

回答

0

我們可以使用依賴屬性傳遞屬性的子控件...

問候 Jegan

相關問題