title: MVVM - How to create columns at runtime for a xamdatagrid?
body: <p>I have to create a XamDataGrid that shows a dynamic amount of columns for a time frame x to y. Therefore I dont know how many years a user would select to have these columns created upfront.</p>
  
  <p>Now usualy within MVVM you would just populate the data through as many Properties as you would need Columns within your XamDataGrid, and the latter would just autogenerate them.</p>
  
  <p>Obviously I couldn't just create Properties within my ViewModel at runtime unless I did something crazy with Reflection.</p>
  
  <p>How else would I achieve this?</p>
  
  <p>Should I just create unbound fields for the datagrid and fill them through code? I agree I wont need a two way Binding at this stage, since the grid is only readonly...just thinking loud.</p>
  
  <p>Is this approach OK without violating the MVVM pattern?
  Thanks</p>