This is a migrated thread and some comments may be shown as answers.

Adding controls to a TileView

3 Answers 148 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Jose Simas
Top achievements
Rank 2
Jose Simas asked on 09 Oct 2009, 11:54 AM
Hi,

First let me tell you I find the TileView control awesome and I am planning wide use of it for our next iteration. I have a problem though. I need to "inject" UserControls into the Content, SmallContent and LargeContent at runtime because my UserControls are created by Unity (the dependency Injection framework used in PRISM). 

I inject the controls in the contructor of the window and it works but when I show the control the app becomes unresponsive and when I pause in the debigger this is where it stops:

Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadFluidContentControl.MeasureOverride(System.Windows.Size availableSize = {System.Windows.Size}) Line 345 + 0x19 bytes.

I tried doing it all in code:

var viewItem = new RadTileViewItem(); 
var content = new RadFluidContentControl(); 
content.SmallToNormalThreshold = new Size(235, 35); 
content.NormalToSmallThreshold = new Size(305, 149); 
content.NormalToLargeThreshold = new Size(315, 155); 
content.LargeToNormalThreshold = new Size(725, 345); 
content.SmallContent = new TextBlock {Text = "Original Data"}; 
content.Content = ResolveControl<OriginalData, UDataTable>(); 
 
viewItem.Content = content; 
projectData.Items.Add(viewItem); 


And the xaml is:

<telerikNavigation:RadTileView x:Name="projectData" Margin="3"></telerikNavigation:RadTileView>

I also tried a combination of xaml and code using the xaml from your demo app:

The code was something like:

var s = (((projectData.Items[0] as ContentControl).Content) as RadFluidContentControl); 
s.Content = _unityContainer.Resolve&lt;MyUserControl&gt;(); 
I am using the exact xaml from your demo except for the contents which are replaced by this since then cannot be empty:

<telerikNavigation:RadFluidContentControl.Content>
         <Data:OriginalData></Data:OriginalData>
</telerikNavigation:RadFluidContentControl.Content>

Finally I tried using a Panel inside the contents and added my usecontrol to the panel but the results were the same.

I must be missing something critical and any help is appreciated,
Jose

3 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 13 Oct 2009, 08:21 AM
Hi Jose,

From your desciption of the problem it seems you discovered a bug in the FluidContentControl. We will investigate the issue as soon as possible. I was able to reproduce the problem, but it would be very helpful if you can provide a project that demonstrates your exact scenario, since that way we will be able to investigate what is the cause in your specific case.

Kind regards,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jose Simas
Top achievements
Rank 2
answered on 14 Oct 2009, 04:27 PM
Hi Tihomir,

I would love to help but I am unable to put together a simple scenario with the same symptoms. In my application the TileView sits on a Usercontrol that sits on yet another Usercontrol which is hosted inside a docking manager by Actipro. And everything is injected with Unity (it is a PRISM based application). As you can see it is difficult for me to put together a proper example without sending the whole application. I created a simple application with bits of the code but in that case the bug does not manifests itself. But since you were able to duplicate the problem there is hope!

If it helps, I managed to work around the problem by setting the MaxWidth and MaxHeight (set to 2000 and 1500) of the control I am assigning to the LargeContent. Not ideal as it will break my interface at very high resolutions and it also appears to run slower.

Jose
0
Tihomir Petkov
Telerik team
answered on 14 Oct 2009, 05:46 PM
Hello Jose,

Thank you for the additional info - it should be helpful.

Regards,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TileView
Asked by
Jose Simas
Top achievements
Rank 2
Answers by
Tihomir Petkov
Telerik team
Jose Simas
Top achievements
Rank 2
Share this question
or