[amd64/tramp] hide interpreter specific trampoline behind ifdef
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / View / ErrorView.xaml.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4
5 namespace System.Activities.Presentation.View
6 {
7     using System;
8     using System.Collections.Generic;
9     using System.Linq;
10     using System.Text;
11     using System.Windows;
12     using System.Windows.Controls;
13     using System.Windows.Data;
14     using System.Windows.Documents;
15     using System.Windows.Input;
16     using System.Windows.Media;
17     using System.Windows.Media.Imaging;
18     using System.Windows.Navigation;
19     using System.Windows.Shapes;
20
21     // This class will be the error view presented when there are exceptions or errors
22     // in the designer view, or when we are unable to load the designer.
23     sealed partial class ErrorView : UserControl
24     {
25
26         public static readonly DependencyProperty MessageProperty =
27             DependencyProperty.Register("Message", typeof(string), typeof(ErrorView), new UIPropertyMetadata(string.Empty));
28
29         public static readonly DependencyProperty DetailsProperty =
30             DependencyProperty.Register("Details", typeof(string), typeof(ErrorView), new UIPropertyMetadata(string.Empty));
31
32
33         public ErrorView()
34         {
35             InitializeComponent();
36             this.DataContext = this;
37         }
38
39         public string Message
40         {
41             get { return (string)GetValue(MessageProperty); }
42             set { SetValue(MessageProperty, value); }
43         }
44
45         public string Details
46         {
47             get { return (string)GetValue(DetailsProperty); }
48             set { SetValue(DetailsProperty, value); }
49         }
50
51         public EditingContext Context { get; set; }
52
53         private void OnHelpExecuted(object sender, ExecutedRoutedEventArgs e)
54         {
55             if (this.Context == null)
56             {
57                 return;
58             }
59             IIntegratedHelpService help = this.Context.Services.GetService<IIntegratedHelpService>();
60             if (help != null)
61             {
62                 help.ShowHelpFromKeyword(HelpKeywords.ErrorView);
63             }
64             else
65             {
66                 System.Diagnostics.Process.Start(SR.DefaultHelpUrl);
67             }
68         }
69
70
71     }
72 }