-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelpWindow.axaml.cs
51 lines (46 loc) · 1.56 KB
/
HelpWindow.axaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Diagnostics;
using System.Text;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
namespace ScottPlot.Avalonia
{
public class HelpWindow : Window
{
public HelpWindow()
{
this.InitializeComponent();
this.Find<TextBlock>("VersionLabel").Text = Plot.Version;
StringBuilder msg = new StringBuilder();
msg.AppendLine("Left-click-drag: pan");
msg.AppendLine("Right-click-drag: zoom");
msg.AppendLine("Middle-click-drag: zoom region");
msg.AppendLine("");
msg.AppendLine("Right-click: show menu");
msg.AppendLine("Middle-click: auto-axis");
msg.AppendLine("Double-click: show benchmark");
msg.AppendLine("");
msg.AppendLine("Hold CTRL to lock vertical axis");
msg.AppendLine("Hold ALT to lock horizontal axis");
this.Find<TextBlock>("InfoTextBlock").Text = msg.ToString();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
private void LaunchScottPlotWebsite(object sender, RoutedEventArgs e)
{
using (Process proc = new Process())
{
proc.StartInfo.FileName = "https://ScottPlot.NET";
proc.StartInfo.UseShellExecute = true;
proc.Start();
}
}
private void CloseButtonClicked(object sender, RoutedEventArgs e)
{
Close();
}
}
}