diff --git a/src/AddIns/Misc/UsageDataCollector/AnalyticsMonitor.cs b/src/AddIns/Misc/UsageDataCollector/AnalyticsMonitor.cs index a885f5d8ca..1a75258a00 100644 --- a/src/AddIns/Misc/UsageDataCollector/AnalyticsMonitor.cs +++ b/src/AddIns/Misc/UsageDataCollector/AnalyticsMonitor.cs @@ -33,12 +33,20 @@ namespace ICSharpCode.UsageDataCollector } set { PropertyService.Set("ICSharpCode.UsageDataCollector.Enabled", value.ToString()); - if (value) { - Instance.OpenSession(); - } else { - Instance.CloseSession(); - Instance.TryDeleteDatabase(); - } + // Initially opening the session takes some time; which is bad for the startpage + // because the animation would start with a delay. We solve this by calling Open/CloseSession + // on a background thread. + ThreadPool.QueueUserWorkItem(delegate { AsyncEnableDisable(); } ); + } + } + + static void AsyncEnableDisable() + { + if (Enabled) { + Instance.OpenSession(); + } else { + Instance.CloseSession(); + Instance.TryDeleteDatabase(); } } diff --git a/src/AddIns/Misc/UsageDataCollector/CollectedDataView.xaml b/src/AddIns/Misc/UsageDataCollector/CollectedDataView.xaml index 82e95d603f..fc1a611a98 100644 --- a/src/AddIns/Misc/UsageDataCollector/CollectedDataView.xaml +++ b/src/AddIns/Misc/UsageDataCollector/CollectedDataView.xaml @@ -15,7 +15,7 @@ Margin="16,8,16,8" Click="Button_Click" /> \ No newline at end of file diff --git a/src/Main/ICSharpCode.Core.Presentation/CollapsiblePanel.cs b/src/Main/ICSharpCode.Core.Presentation/CollapsiblePanel.cs index 47f1de87d4..2b0ecc4f13 100644 --- a/src/Main/ICSharpCode.Core.Presentation/CollapsiblePanel.cs +++ b/src/Main/ICSharpCode.Core.Presentation/CollapsiblePanel.cs @@ -35,7 +35,7 @@ namespace ICSharpCode.Core.Presentation public static readonly DependencyProperty DurationProperty = DependencyProperty.Register( "Duration", typeof(TimeSpan), typeof(CollapsiblePanel), - new UIPropertyMetadata(TimeSpan.FromMilliseconds(500))); + new UIPropertyMetadata(TimeSpan.FromMilliseconds(250))); /// /// The duration in milliseconds of the animation.