和滾動在了Windows Phone 8的項目我創建一個TChart一個用戶控件裏面是這樣的:的TeeChart變焦在Windows Phone 8
Chart.Legend.LegendStyle = LegendStyles.Series;
Chart.Legend.Alignment = LegendAlignments.Bottom;
Chart.Header.Visible = false;
if (Page.ZoomMode)
{
Chart.Aspect.GestureOptions = Steema.TeeChart.Silverlight.Drawing.Aspect.Gestures.PinchAndDrag;
Chart.Aspect.GestureStyle = Steema.TeeChart.Silverlight.Drawing.Aspect.GestureStyles.FullChart;
}
else
{
Chart.Aspect.GestureOptions = Steema.TeeChart.Silverlight.Drawing.Aspect.Gestures.None;
Chart.Aspect.GestureStyle = Steema.TeeChart.Silverlight.Drawing.Aspect.GestureStyles.InChart;
}
var theme = ThemeManager.GetDefaultTChartTheme(Chart.Chart);
theme.Apply();
的用戶控件是一個PivotItem裏面。這個想法是在縮放模式下鎖定數據透視表,以允許圖表響應拖動&捏手勢。
問題1:第一個平局之後動態變化Chart.Aspect.GestureStyle和Chart.Aspect.GestureOptions推出此異常:
System.InvalidOperationException: Element is already the child of another element.
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value)
at System.Windows.PresentationFrameworkCollection`1.Add(T value)
at Steema.TeeChart.Silverlight.Drawing.TBlockCanvas.ShowImage()
at Steema.TeeChart.Silverlight.TChart.Draw(Rect rect)
at Steema.TeeChart.Silverlight.TChart.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
問題2:如果第一個平局是啓用變焦。鎖定樞軸後似乎都有效,我可以在屏幕上拖動圖表。但每次我加載新的系列後tChart.Series.Clear()渲染的圖像一次又一次地取代...
我希望有人能幫助我。謝謝!
在我看來,第一個錯誤是在Teechart內部,並且會阻止您動態修改這些手勢值。您可能需要研究其他方法以獲得理想的行爲。 – steveg89