1、在XAML里直接引用没有问题
2、在代码里引用就会引发以上异常
解决方法
AxShockwaveFlash flashPlayer;
public UCFlashPlayer()
{
InitializeComponent();
if (Windows.SystemIsRunning)
{
flashPlayer = new AxShockwaveFlash();
winformHost.Child = flashPlayer;
flashPlayer.OnReadyStateChange += flashPlayer_OnReadyStateChange;
((System.ComponentModel.ISupportInitialize)(this.flashPlayer)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.flashPlayer)).EndInit();
}
}