0

I have two listviews. When selecting one item in listview1, corresponding data of the item will be loaded in listview2. Before applying resizable feature(which is using auto resize and dockpanel), when selecting items on listview1, data is loaded smoothly to listview2. After making it resizable, data gets loaded after a few seconds delay. How does resizable (dockpanel) affect the performance? How to fix this... Thanks in advance.

Here is how I use dock panel.

<Grid.RowDefinitions>
    <RowDefinition />
    <RowDefinition Height="80" />
    <RowDefinition Height="40" />
    <RowDefinition  />
    <RowDefinition Height="40" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
    <ColumnDefinition />
    <ColumnDefinition Width="20" />
    <ColumnDefinition  />
</Grid.ColumnDefinitions>


<DockPanel Grid.Row="X" Grid.Column="Y" Grid.RowSpan="1" HorizontalAlignment="Stretch"  Name="DockPanel1"  Margin="0">
//element here
</DockPanel>

C#

//How I load data
//load gets loaded in listveiw1 when open PWF window
public MainWindow()
{
    InitializeComponent();
    listView1.Items.Add(item);
}
//listview2
private void listView1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    if (listView1.SelectedItem != null)
    {
     //do something here, then load data of selected item in listview1 to listview2
     listView2.Items.Add(data);
    }
}
4

0 回答 0