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/>
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
Hello Peter,
I have been looking into your post and I tried to reproduce the strange behavior that you are describing on my side. For this I create two projects-one executable and one WPF User Control Library using your code and version 11.1 build 1002 of our assemblies . In my test sample I just replace both images with TextBlocks and I get the absolutely same design for both cases. I am attaching the design view fro, the library project:
Would you provide me with both project that you use in order to create the issue on your side so I can continue my investigation on this matter.
Thanks in advance.
Hello Elena,
I'm sorry I brought this problem up prematurely. After a couple of recompiling the controllibrary and closing and opening visual studio, my design view is correct as well. I also build up a clean solution to reproduce the problem, and it didn't occur.
So the problem seems to be further down the road in our app. It is just strange because every other default control (textboxes, labels, etc.) resizes correctly and only the tile control won't. Thats why I suspected the tile control (that and some weird visual studio behaviour :) - sometimes just opening a solution the next day fixes some problems).
Thank you for your efforts!