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
495
Can I define CardView styles and Grid styles from XAML?
posted

Hi, I am trying to display a dataPresenter (using MVVM with minimal code in codebehind) that depends on the number of elements to determine if it is displayed as a Grid or in Cardview.

 

If there is only one element in the BindingList, I want to show Cardview with the following fields:

 

<igDP:Field Name="Description" Label="Description" Row="0" Column="0" Width="*"/>

<igDP:Field Name="Market" Label="Country of Incorp:" Row="1" Column="0" Width="*"/>

<igDP:Field Name="Mkt" Label="Tax Country:" Row="2" Column="0" Width="*"/>

<igDP:Field Name="RecordDate" Label="Record Date" Row="3" Column="0" Width="*"/>

<igDP:Field Name="Ticker" Label="Ticker" Row="0" Column="1" Width="*"/>

<igDP:Field Name="Sedol" Label="Sedol" Row="1" Column="1" Width="*"/>

<igDP:Field Name="Cusip" Label="CUSIP" Row="2" Column="1" Width="*"/>

 

 

However, if there is more than one element to display, I would like to show it in a traditional grid, where each row represents a different element (and all the columns are simply next to eachother).

 

I haven't seen a sample yet where the columns are explicitly defined for cardview vs. grid view, and I haven't really seen a sample that declares the datapresenter view from the viewmodel.

 

Can you please help?  Thanks in advance.