Hi,
I would like to add a custom view to my xamDataPresenter in order to display images in a WrapPanel.
So, I think that I must implement my own View (from ViewBase), but can you help me to acheive this ?
I have try, but the Records are not wrapped !
My XAML :
<vov:WrapView x:Key="ThumbnailsView"> </vov:WrapView>
Here is the class I use :
public class WrapView : Infragistics.Windows.DataPresenter.ViewBase { protected override CellPresentation CellPresentation { get { return CellPresentation.CardView; } } protected override FieldLayoutTemplateGenerator GetFieldLayoutTemplateGenerator(FieldLayout fieldLayout) { return new CardViewFieldLayoutTemplateGenerator(fieldLayout); } protected override bool HasLogicalOrientation { get { return true; } } protected override Type ItemsPanelType { get { return typeof(WrapPanel); } } // protected override Type RecordPresenterContainerType //{ // get // { // return base.RecordPresenterContainerType; // } //} protected override bool IsNestedPanelsSupported { get { return true; } } protected override bool IsFixedRecordsSupported { get { return true; } } }
Yes,
They are displayed, but horizontally, and a scrollbar appear !
I have try, but the parent of my custom WrapPanel is null !
So, I have exactly the same effect !
Here is my code :
sealed public class xamWrapPanel : WrapPanel { protected override System.Windows.Size MeasureOverride(System.Windows.Size constraint) { if (Parent == null) return base.MeasureOverride(constraint); FrameworkElement uiElement = (FrameworkElement)Parent; return base.MeasureOverride(new Size(uiElement.ActualWidth, uiElement.ActualHeight)); } }
ScrollContentPresenter scp = Infragistics.Windows.Utilities.GetAncestorFromType(this, typeof(ScrollContentPresenter), false) as ScrollContentPresenter;
Thanks
But the size of scp = 0,0 !!!!
Do you have any solution for this problem ?
Can someone help us ?
I does find any solution
It should be possible !
Please help....
Hi Joe,
I have try several combinations, but none work :-(
How can I access the DataRecord through binding, I have try {Binding Title} and some others, but no data is displayed !
You're right, thanks.
I have do what you say and it is better, but it sounds that having
<ContentPresenter x:Name="PART_RecordContentSite"/>
is mandatory, or it crash !
What I want :
- Display an image binded to a property of my datasource, say "CoverImage"
- a title binded to the "Title" property
- I must be able to double click on the title and rename it, like for GridView
Do you have an idea on how I can acheive this ?