如果我使用:
<oxy:PlotView MinHeight="260" Height="Auto" IsRendering="True" FontStyle="Normal" FontFamily="Arial" FontSize="8" Model="{Binding PlotM}">
</oxy:PlotView>
正确显示情节。
如果我使用此代码:
<ListView Name="PlotLista" ItemsSource="{Binding PlotModelList}" >
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<oxy:PlotView MinHeight="260" Height="Auto" IsRendering="True" FontStyle="Normal" FontFamily="Arial" FontSize="8" Model="{Binding}">
</oxy:PlotView>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
显示bkank元素列表,未显示OxyPlot。 PlotModelList是List<PlotModel>
答案 0 :(得分:0)
问题是宽度和高度:
<ListView Name="PlotLista" ItemsSource="{Binding PlotModelList}" >
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<oxy:PlotView MinHeight="260" Height="Auto" HorizontalContentAlignment="Stretch" MinWidth="700" IsRendering="True"
FontStyle="Normal" FontFamily="Arial" FontSize="8" Model="{Binding}">
</oxy:PlotView>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>