Tab Control and Focus issue

Oct 20, 2008 at 6:21 PM
Does anyone have any ideas for a workaround for this isssue, described here:$0$0$0$0We could use a way for the default focus to be whatever is clicked (or anything inside a TabItem).  The current implementation of AvalonDock requires two mouse clicks in order to set focus on an object inside a TabItem, when the TabControl is contained inside a DockableContent.  Any suggestions?  Setting the DefaultElement doesn't work because there may be more than one element inside the TabItem.$0$0$0$0$0Thanks.$0
Oct 22, 2008 at 5:52 PM
Hi, in my internal version issue you reported is fixed. I'm just preparing the release including other bug fixes and more. I'll post this in one or two days. Ado
Oct 22, 2008 at 7:32 PM
Hi Ado,$0$0$0$0When you say "fixed," do you mean you can now click on any number of objects inside a tab item, and whatever one is clicked automatically gets focus?  Or do you mean you can only set one item as the "default element?"$0$0$0$0$0Thanks!$0
Oct 23, 2008 at 8:18 AM
I mean that I reproduced the issue you reported in workitemId=6234 with AvalonDockDemo and it works fine. There was a problem related to focus management that I corrected in managedcontent.cs. Ado
Oct 23, 2008 at 1:05 PM
Thanks, Ado.  Will it work with multiple buttons too, not just setting one default element?  Meaning, if their are two buttons, whichever button is clicked will get immediate focus?  Thanks.
Oct 23, 2008 at 2:32 PM
Yes I tested with code like this:



                                <TabControl x:Name="tabControl">
                                    <TabItem Header="TabItem Header" >
                                        <Button x:Name="ButtonDefault" Click="Button_Click">Click me</Button>
                                    <TabItem Header="TabItem Header2" >
                                        <StackPanel Orientation="Vertical">
                                            <Button x:Name="ButtonDefault2" Click="Button_Click">Click me</Button>
                                            <Button x:Name="ButtonDefault3" Click="Button_Click">Click me</Button>
end seems to work fine.
Thanks to you, Ado

Oct 23, 2008 at 2:35 PM
Perfect!  Thanks for your help.  I'll watch out closely for the new version.