Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
XamTilesControl does not resize when used in WpfControlLibrary
posted

Hi,

I stumbled across a very strange issue with the XamTilesControl.

There seems to be some difference of the resizing behaviour depending on whether the control is within an 'Windows-Executable' project or within an 'Assembly' project.

If I put a simple TileControl in a 'Windows-Executable' Project, the maximized Tile will automatically stretch to the available width and handle resizing correctly. The Control is also displayed correctly in DesignView.

<UserControl x:Class="DummyTile">

<igTiles:XamTilesControl>
        <igTiles:Tile Header="first" State="Maximized">
            <Image Source="/WpfDesignerTests;component/Images/Table.png" />
        </igTiles:Tile>
 
        <Image Source="/WpfDesignerTests;component/Images/Sitemap.png" />
        
    </igTiles:XamTilesControl>
</UserControl>

When I put the very same Code in an 'Assembly' Project or 'ControlLibrary'-Project (which essentially is a AssemblyProject, you already notice that the DesignView does not stretch the control anymore (images remain original size and maximized tile does not get bigger).

The funny thing is, if you include that "DummyTile" from the AssemblyProject in an 'WindowsExecutable' Project, the resizing works again:

In WindowsExecutableProject use "DummyTile" (Code above is now in Assembly Project)

<UserControl x:Class="WpfDesignerTests.XamTilesControl.View"
             xmlns:Tiles="clr-namespace:WpfCustomControlLibrary.Tiles;assembly=WpfCustomControlLibrary">
             
    <Tiles:DummyTile/>
</UserControl> 

Here you will see the correct stretching of the maximized tile.

Finally coming to our problem - we are using our control library directly via MEF / Prism. So that UserControl "DummyTile" from the control library gets an [Export] Attribute and is directly injected into our view. Doing this, the XamTilesControl won't stretch it's Maximized Tile anymore (no matter how many HorizontalAlignment tags are set). Even setting the width, DesiredSize or RenderSize have no effect. The XamTilesControl has a constant width and height and if the window is getting too small for the control, scrollbars will appear instead of the rearranging of the tiles (as is default behaviour).

Is there a workaround for this strange behaviour? Why would the XamTilesControl using the exact same code behave differently depending on the containing project type?!

We're using InfragisticsWPF4.Tiles.v11.1 Version 1002.

Thank you for your answer,

Peter