Hello,
I have a problem with tooltip on my lineserie. I am creating my lineseries in code behind. So with the code below I am trying to create a lineserie and a tooltip for that. But when I came over to my lineserie with the mouse It throws "Can not create top-level child window" error. Could you help about this problem
Thanks
//Create Lineseri LineSeries lineSeri = new LineSeries(); lineSeri.ItemsSource = each.DefaultView; lineSeri.ValueMemberPath = _vm.ChartYAxisValueMemberPath; lineSeri.XAxis = xAxis; lineSeri.YAxis = yAxis; lineSeri.TrendLineZIndex = 1; lineSeri.Title = "TestTitle"; //Create Tooltip StackPanel spMain = new StackPanel(); TextBlock txtBlock1 = new TextBlock(); txtBlock1.Text = "TestText: "; spMain.Children.Add(txtBlock1); lineSeri.ToolTip = spMain; xamDataChart1.Series.Add(lineSeri);
//Create Lineseri
LineSeries lineSeri = new LineSeries();
lineSeri.ItemsSource = each.DefaultView;
lineSeri.ValueMemberPath = _vm.ChartYAxisValueMemberPath;
lineSeri.XAxis = xAxis;
lineSeri.YAxis = yAxis;
lineSeri.TrendLineZIndex = 1;
lineSeri.Title = "TestTitle";
//Create Tooltip
StackPanel spMain = new StackPanel();
TextBlock txtBlock1 = new TextBlock();
txtBlock1.Text = "TestText: ";
spMain.Children.Add(txtBlock1);
lineSeri.ToolTip = spMain;
xamDataChart1.Series.Add(lineSeri);
<baseControl:GraphsBaseUserControl x:Class="SPKPlugin.PresentationLayer.HisseDashboard" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ig="http://schemas.infragistics.com/xaml" xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" xmlns:igEditors="http://infragistics.com/Editors" xmlns:igDP="http://infragistics.com/DataPresenter" xmlns:Utils="clr-namespace:SPKPlugin.PresentationLayer.Utils" xmlns:baseControl="clr-namespace:SPKPlugin.PresentationLayer" xmlns:controls ="clr-namespace:SPKGozetim.Common.PresentationLayer.Controls;assembly=SPKGozetim.Common" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <baseControl:GraphsBaseUserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/SPKGozetim.Common;component/PresentationLayer/Controls/OptionsPanel.xaml"/> <ResourceDictionary Source="pack://application:,,,/SPKPlugin;component/PresentationLayer/StyleTest.xaml"/> </ResourceDictionary.MergedDictionaries> <ig:StringFormatConverter x:Key="AxisRangeValueConverter" /> <ItemsPanelTemplate x:Key="ListBoxItemsPanelTemplateH"> <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" /> </ItemsPanelTemplate> <Utils:IsNullConverter x:Key="IsNullConverter"></Utils:IsNullConverter> <Utils:HisseEkleMultiValueConverter x:Key="MultiValueConverter"></Utils:HisseEkleMultiValueConverter> </ResourceDictionary> </baseControl:GraphsBaseUserControl.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <ig:XamDataChart Name="xamDataChart1" HorizontalZoomable="True" Grid.Row="0" HorizontalZoombarVisibility="Visible" VerticalZoomable="False" Margin="0,0,0,0" Legend="{Binding ElementName=xmLegend}"> <ig:SyncManager.SyncSettings> <ig:SyncSettings SyncChannel="Group1" SynchronizeHorizontally="True" SynchronizeVertically="False" /> </ig:SyncManager.SyncSettings> <ig:XamDataChart.Axes> <ig:CategoryDateTimeXAxis x:Name="xAxis" DateTimeMemberPath="TARIH" Gap="2" Interval="{Binding ElementName=sldYAxisInterval, Path=Value, Converter={StaticResource AxisRangeValueConverter}, ConverterParameter='0'}"> <ig:CategoryDateTimeXAxis.LabelSettings> <ig:AxisLabelSettings Location="OutsideBottom" Extent="40" Angle="270" /> </ig:CategoryDateTimeXAxis.LabelSettings> <ig:CategoryDateTimeXAxis.Label> <DataTemplate> <TextBlock Text="{Binding Item.Date, StringFormat={}{0:dd.MM} }" Margin="-25,0,0,0" FontSize="10" /> </DataTemplate> </ig:CategoryDateTimeXAxis.Label> <ig:CategoryDateTimeXAxis.Style> <Style TargetType="ig:Axis"> <Setter Property="MajorStrokeThickness" Value="0"/> </Style> </ig:CategoryDateTimeXAxis.Style> </ig:CategoryDateTimeXAxis> <ig:NumericYAxis x:Name="yAxis" Label="{}{0:P}"> <ig:NumericYAxis.LabelSettings> <ig:AxisLabelSettings Location="InsideLeft" /> </ig:NumericYAxis.LabelSettings> <ig:NumericYAxis.Style> <Style TargetType="ig:Axis"> <Setter Property="MajorStrokeThickness" Value="0"/> </Style> </ig:NumericYAxis.Style> </ig:NumericYAxis> <ig:NumericYAxis x:Name="yAxisVol" Label="{}{0:N0}"> <ig:NumericYAxis.LabelSettings> <ig:AxisLabelSettings Location="InsideRight" /> </ig:NumericYAxis.LabelSettings> <ig:NumericYAxis.Style> <Style TargetType="ig:Axis"> <Setter Property="MajorStrokeThickness" Value="0"/> </Style> </ig:NumericYAxis.Style> </ig:NumericYAxis> </ig:XamDataChart.Axes> </ig:XamDataChart> </Grid> </baseControl:GraphsBaseUserControl>
<baseControl:GraphsBaseUserControl x:Class="SPKPlugin.PresentationLayer.HisseDashboard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ig="http://schemas.infragistics.com/xaml"
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
xmlns:igEditors="http://infragistics.com/Editors"
xmlns:igDP="http://infragistics.com/DataPresenter"
xmlns:Utils="clr-namespace:SPKPlugin.PresentationLayer.Utils"
xmlns:baseControl="clr-namespace:SPKPlugin.PresentationLayer"
xmlns:controls ="clr-namespace:SPKGozetim.Common.PresentationLayer.Controls;assembly=SPKGozetim.Common"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<baseControl:GraphsBaseUserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/SPKGozetim.Common;component/PresentationLayer/Controls/OptionsPanel.xaml"/>
<ResourceDictionary Source="pack://application:,,,/SPKPlugin;component/PresentationLayer/StyleTest.xaml"/>
</ResourceDictionary.MergedDictionaries>
<ig:StringFormatConverter x:Key="AxisRangeValueConverter" />
<ItemsPanelTemplate x:Key="ListBoxItemsPanelTemplateH">
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" />
</ItemsPanelTemplate>
<Utils:IsNullConverter x:Key="IsNullConverter"></Utils:IsNullConverter>
<Utils:HisseEkleMultiValueConverter x:Key="MultiValueConverter"></Utils:HisseEkleMultiValueConverter>
</ResourceDictionary>
</baseControl:GraphsBaseUserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ig:XamDataChart Name="xamDataChart1"
HorizontalZoomable="True" Grid.Row="0"
HorizontalZoombarVisibility="Visible"
VerticalZoomable="False"
Margin="0,0,0,0"
Legend="{Binding ElementName=xmLegend}">
<ig:SyncManager.SyncSettings>
<ig:SyncSettings SyncChannel="Group1"
SynchronizeHorizontally="True"
SynchronizeVertically="False" />
</ig:SyncManager.SyncSettings>
<ig:XamDataChart.Axes>
<ig:CategoryDateTimeXAxis x:Name="xAxis"
DateTimeMemberPath="TARIH" Gap="2"
Interval="{Binding ElementName=sldYAxisInterval, Path=Value, Converter={StaticResource AxisRangeValueConverter}, ConverterParameter='0'}">
<ig:CategoryDateTimeXAxis.LabelSettings>
<ig:AxisLabelSettings Location="OutsideBottom" Extent="40" Angle="270" />
</ig:CategoryDateTimeXAxis.LabelSettings>
<ig:CategoryDateTimeXAxis.Label>
<DataTemplate>
<TextBlock Text="{Binding Item.Date, StringFormat={}{0:dd.MM} }" Margin="-25,0,0,0" FontSize="10" />
</DataTemplate>
</ig:CategoryDateTimeXAxis.Label>
<ig:CategoryDateTimeXAxis.Style>
<Style TargetType="ig:Axis">
<Setter Property="MajorStrokeThickness" Value="0"/>
</Style>
</ig:CategoryDateTimeXAxis.Style>
</ig:CategoryDateTimeXAxis>
<ig:NumericYAxis x:Name="yAxis" Label="{}{0:P}">
<ig:NumericYAxis.LabelSettings>
<ig:AxisLabelSettings Location="InsideLeft" />
</ig:NumericYAxis.LabelSettings>
<ig:NumericYAxis.Style>
</ig:NumericYAxis.Style>
</ig:NumericYAxis>
<ig:NumericYAxis x:Name="yAxisVol" Label="{}{0:N0}">
<ig:AxisLabelSettings Location="InsideRight" />
</ig:XamDataChart.Axes>
</ig:XamDataChart>
</Grid>
</baseControl:GraphsBaseUserControl>
I found the mistake.
Your application is a full trust application. If you switch your security properties to partial trust application, the tooltip should be visible without exception.
The error occurs only, if you use a full trust security option.But that can't be the finally solution.
I have sort of the same:
System.NullReferenceException occurred HResult=-2147467261 Message=Object reference not set to an instance of an object. Source=InfragisticsWPF4.Controls.Charts.XamDataChart.v12.1 StackTrace: at Infragistics.Controls.Charts.SeriesToolTipManager.UpdateToolTip(Point pt, Object item, Object data) InnerException:
Tnx.
same error continues since I created the topic
Hi,
The tooltip in code example you have uploaded works fine. But when I incorporate the same in my xbap application and hover the mouse over the XamlDataChart, I get the error shown below. Could you please help me fix the issue.I am using Infragistics v11.2:
System.ComponentModel.Win32Exception (0x80004005): Cannot create a top-level child window at MS.Win32.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam) at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks) at System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters) at System.Windows.Interop.HwndSource..ctor(HwndSourceParameters parameters) at System.Windows.Controls.Primitives.Popup.PopupSecurityHelper.BuildWindow(Int32 x, Int32 y, Visual placementTarget, Boolean transparent, HwndSourceHook hook, AutoResizedEventHandler handler) at System.Windows.Controls.Primitives.Popup.BuildWindow(Visual targetVisual) at System.Windows.Controls.Primitives.Popup.CreateWindow(Boolean asyncCall) at System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Infragistics.Controls.Charts.SeriesToolTipManager.UpdateToolTip(Point pt, Object item, Object data) at Infragistics.Controls.Charts.Series.OnMouseEnter(Point pt, Object source, Object data) at Infragistics.Controls.Charts.SeriesView.OnMouseEnter(Object sender, MouseEventArgs e) at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) at System.Windows.MouseOverProperty.FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, Boolean oldValue) at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction) at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction) at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction) at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, IList`1 otherOrigins, DeferredElementTreeState& oldTreeState, Action`2 originChangedAction) at System.Windows.Input.MouseDevice.ChangeMouseOver(IInputElement mouseOver, Int32 timestamp) at System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.StartDispatcherInBrowser(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
I am just checking if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support