Find host from ItemContainerGenerator.itemChanged Event
Posted
by
Mohanavel
on Stack Overflow
See other posts from Stack Overflow
or by Mohanavel
Published on 2011-01-03T14:53:00Z
Indexed on
2011/01/03
15:54 UTC
Read the original article
Hit count: 210
I'm working on C# 4.0, WPF. I have three ListView, and all three control have the same ItemContainerGenerator_ItemsChanged" event. So my problem is, when ever the event triggered, i have to find the host.
lst1.ItemContainerGenerator.ItemsChanged += new System.Windows.Controls.Primitives.ItemsChangedEventHandler(ItemContainerGenerator_ItemsChanged);
lst2.ItemContainerGenerator.ItemsChanged += new System.Windows.Controls.Primitives.ItemsChangedEventHandler(ItemContainerGenerator_ItemsChanged);
lst3.ItemContainerGenerator.ItemsChanged += new System.Windows.Controls.Primitives.ItemsChangedEventHandler(ItemContainerGenerator_ItemsChanged);
void ItemContainerGenerator_ItemsChanged(object sender, System.Windows.Controls.Primitives.ItemsChangedEventArgs e)
{
//TODO: Find host and proceed.
**REAL Problem**
// ListViewItem's Visible property has been set based on the deletion button click,
// So at one place i have to get the count of rows which are visible and proceed
// with related buttons enable/disable operation.
}
© Stack Overflow or respective owner