I have a ListView with Orientation="Horizon"
which means that DataTemplate
will look like "column" instead of row. Everything works fine and ListView shows a scroll bar when I have a lot of columns that cant be showed in screen. I have set MinWidth
for DataTemplate. What I am trying to accomplish is that in case my source
has less than 3 object to expand Datatemplate's width to fit the screen of ListView.
I am aware that I can get the current width of the window using:
System.Windows.SystemParameters.PrimaryScreenWidth;
System.Windows.SystemParameters.PrimaryScreenHeight;
What I need is a callback method to be executed when the size of the window is changed in order to update the DataTemplates width. Is this functionality exists in WPF? Are there are any alternatives?