我在使用 ItemControl、DataTemplate 和 Visifire 图表时遇到问题。
首先,XAML中的代码如下
<DataTemplate x:Key="markerChartTemplate">
<vc:Chart Height="200" Theme="Theme1" Style="{StaticResource ChartStyle}">
<vc:Chart.Series>
<vc:DataSeries RenderAs="Line" LightWeight="true" ShadowEnabled="false" LightingEnabled="false" MarkerSize="4" LineThickness="1" DataPoints="{Binding _xAxisCollection}" />
<vc:DataSeries RenderAs="Line" LightWeight="true" ShadowEnabled="false" LightingEnabled="false" MarkerSize="4" LineThickness="1" DataPoints="{Binding _yAxisCollection}" />
<vc:DataSeries RenderAs="Line" LightWeight="true" ShadowEnabled="false" LightingEnabled="false" MarkerSize="4" LineThickness="1" DataPoints="{Binding _zAxisCollection}" />
</vc:Chart.Series>
</vc:Chart>
</DataTemplate>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" VerticalScrollBarVisibility="Auto">
<ItemsControl VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ItemsSource="{Binding Path=_markerChartsCollections}" ItemTemplate="{StaticResource markerChartTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
_markerChartsCollections
定义为
public ObservableCollection<My3DLineChartObject> _markerChartsCollections
在 ViewModel 和 Model 中。
现在,在 Model 中,我初始化了两个My3DLineChartObject
对象并将其放入_markerChartsCollections
.
结果是我可以在 _markerChartsCollections 中看到两个与 My3DLineChartObject 相同的数字。但是,无法显示 My3DLineChartObject 中的属性,包括 _xAxisCollection、_yAxisCollection 和 _zAxisCollection。
谁能帮忙看看可能的原因是什么?
输出信息是
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_32\Microsoft.Kinect\v4.0_2.0.0.0__31bf3856ad364e35\Microsoft.Kinect.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\Users\admin\Desktop\Hand\SkeletonMarkerCapture_Good_2\SkeletonMarkerCapture\bin\Debug\AForge.Imaging.dll'. Cannot find or open the PDB file.
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\Users\admin\Desktop\Hand\SkeletonMarkerCapture_Good_2\SkeletonMarkerCapture\bin\Debug\Emgu.CV.dll'. Module was built without symbols.
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\Users\admin\Desktop\Hand\SkeletonMarkerCapture_Good_2\SkeletonMarkerCapture\bin\Debug\Emgu.Util.dll'. Module was built without symbols.
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\Users\admin\Desktop\Hand\SkeletonMarkerCapture_Good_2\SkeletonMarkerCapture\bin\Debug\AForge.dll'. Cannot find or open the PDB file.
The thread 0x75d4 has exited with code 259 (0x103).
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll'. Cannot find or open the PDB file.
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll'. Cannot find or open the PDB file.
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\Users\admin\Desktop\Hand\SkeletonMarkerCapture_Good_2\SkeletonMarkerCapture\bin\Debug\GalaSoft.MvvmLight.dll'. Symbols loaded.
'SkeletonMarkerCapture.vshost.exe' (CLR v4.0.30319: SkeletonMarkerCapture.vshost.exe): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.`enter code here`0__31bf3856ad364e35\UIAutomationTypes.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.