Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LayoutAccessor.TabablzControl is null if wrapped in grid #159

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Moulde
Copy link

@Moulde Moulde commented Mar 15, 2017

Hi

I ran into this issue where if you wrap the TabablzControl (inside the Layout), in a Grid element like so:

    <Grid>
        <dragablz:TabablzControl x:Name="InitialTabablzControl"
                             FixedHeaderCount="1"
                             Style="{StaticResource TabablzControlStyle}"
                             AddLocationHint="After">
            <dragablz:TabablzControl.InterTabController>
                <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" Partition="2AE89D18-F236-4D20-9605-6C03319038E6" />
            </dragablz:TabablzControl.InterTabController>
        </dragablz:TabablzControl>
    </Grid>

It can be reproduced in the BoundExampleWindow.xaml sample.
After wrapping in Grid, the "Query Layouts" no longer works.

After wrapping the element in Grid, the LayoutAccessor can no longer find the tabablzControl as this is not the direct child of the Layout element.

The LayoutAccessor currently does this

        var branch = Layout.Content as Branch;
        if (branch != null)
            _branchAccessor = new BranchAccessor(branch);
        else
        {
            _tabablzControl = Layout.Content as TabablzControl;
        }

But after wrapping the TabablzControl in the grid, like above. The above line results in null, as Grid cant be converted to TabablzControl type.

I figure it should instead traverse down untill it finds the TabablzControl.


Changed LayouAccessor constructor to look for TabablzControl instead of just (trying to) convert Layout.Content to TabablzControl.

mha added 2 commits March 15, 2017 09:41
Changed LayouAccessor constructor to look for TabablzControl instead of just (trying to) convert Layout.Content to TabablzControl.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant