I am trying out SciChart ( and WPF ) for a large dataset and till so far very pleased with the results. I have followed the example as described here http://support.scichart.com/index.php?/Knowledgebase/Article/View/17258/0/creating-a-custom-scichartoverview-with-many-series-using-the-scrollbar-api and can successfully view my bound data and everything is perfect for the first instance.
However, when I assign this usercontrol to different tabs they still somehow share data about the viewstate ( the overview window does not resize, and the slider thing in front of it stays at the same values. My guess is that it has to do with the messages in ActualSizePropertyProxy , but since I am new to SciChart and WPF I was hoping that maybe someone here knows what it is.
Thanks.
- Michel Moe asked 9 years ago
- You must login to post comments
Hi Michael,
There is a little known ‘feature’ in WPF called TabControl virtualisation. This means if you have two tabs bound to view models, and use a DataTemplate to define your tab content, WPF virtualises and re-uses the tab content. Meaning in your case, you might have one instance of a SciChartSurface on two tabs.
Please see this stack overflow question on Why do Tab Controls Re-use View Instances when changing tabs.
You can actually disable this by using a simple converter technique. It’s worth testing the following out to see if your problem was related to Tab Control Virtualization:
public class NewViewForEachInstanceConverter : IValueConverter
{
private readonly IDictionary<object, object> _views = new Dictionary<object, object>();
public Type ViewType { get; set; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return null;
object view;
_views.TryGetValue(value, out view);
if (view != null) return view;
view = Activator.CreateInstance(ViewType);
_views.Add(value, view);
return view;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
Usage
<UserControl>
<UserControl.Resources>
<Infrastructure:NewViewForEachInstanceConverter
x:Key="NewControlForEachInstanceConverter" ViewType="{x:Type Views:SomeView}" />
</UserControl.Resources>
.....
<TabControl ItemsSource="{Binding ThingsIWantToBeTabs}">
<TabControl.ContentTemplate>
<DataTemplate>
<ContentControl Content="
{Binding Converter={StaticResource NewControlForEachInstanceConverter}}" />
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
</UserControl>
- Andrew Burnett-Thompson answered 9 years ago
- You must login to post comments
I am considering applying server-side licensing for my javerScript application.
In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)
However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)
I wonder if there is a sample code implemented in C++ for server-side licensing.
Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?
- Michel Moe answered 9 years ago
-
Great, glad it helped :) most of the memory in SciChart is held in the DataSeries so unless you have hundreds or thousands of chart instances, it should be fine. Thanks!
- You must login to post comments
Binding the axis visible range in two way mode to the view model solves it completely:
<s:SciChartSurface.XAxis>
<s:DateTimeAxis AxisTitle="X" VisibleRange="{Binding XVisibleRange, Mode=TwoWay}"/>
</s:SciChartSurface.XAxis>
- Istvan Szarka answered 4 years ago
- You must login to post comments
Please login first to submit.