WPF ItemsControl

Sep 26, 2011 at 9:59 PM

Does anyone know of a way to automate WPF ItemsControl's? I tried doing things like applicationWindow.Get<ListView>, applicationWindow.Get<ListControl>, and ("transactionsAutomationId"), applicationWindow.Get<WhiteItemsControl>("transactionsAutomationId")

 

[ControlTypeMapping(CustomUIItemType.Custom)]
    class WhiteItemsControl : CustomUIItem
    {
        public WhiteItemsControl(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener)
        {
        }

        public WhiteItemsControl() { }

        public virtual void FindExpander()
        {
            var container = Container.Get<GroupBox>("TransactionExpander");
            var items = container.Items;
        }
    }

XAML:
<ItemsControl ItemsSource="{Binding Path=Transactions}" AutomationProperties.AutomationId="transactionsAutomationId"> 
<ItemsControl.ItemTemplate> 
<DataTemplate> 
<Transaction:TransactionView></Transaction:TransactionView> 
</DataTemplate> 
</ItemsControl.ItemTemplate> 
</ItemsControl>