-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
134 lines (128 loc) · 8.31 KB
/
MainWindow.xaml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<Window x:Class="RunningLog.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:RunningLog"
mc:Ignorable="d"
xmlns:skia="clr-namespace:SkiaSharp.Views.WPF;assembly=SkiaSharp.Views.WPF"
xmlns:sys="clr-namespace:System;assembly=System.Runtime" Loaded="MainWindow_OnLoaded"
xmlns:ScottPlot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"
Title="跑步日志" Height="770" Width="940" FontSize="13">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Menu Grid.Row="0">
<MenuItem Header="文件">
<MenuItem Header="退出" Click="Exit_Click"/>
</MenuItem>
<MenuItem Header="帮助">
<MenuItem Header="关于" Click="About_Click"/>
</MenuItem>
</Menu>
<local:SlideMessage Grid.Row="1" x:Name="SlideMessage" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,0,0,0" Panel.ZIndex="-1"/>
<Grid Grid.Row="2" Margin="5">
<Grid.Resources>
<Style TargetType="Button">
<Setter Property="Width" Value="60"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Margin" Value="5"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="7*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="浅色" Background="White" Foreground="Black" Click="BtnLightMode_OnClick"/>
<Button Content="深色" Background="Black" Foreground="White" Click="BtnDarkMode_OnClick"/>
</StackPanel>
<Border Grid.Row="1" Grid.Column="0" Name="border" Margin="5"
Background="White"
BorderBrush="Black"
BorderThickness="0"
ToolTip="{Binding ElementName=skElement, Path=ToolTip}" >
<skia:SKElement x:Name="skElement" PaintSurface="OnPaintSurface" />
</Border>
<StackPanel Grid.Column="1" Grid.Row="1" Orientation="Vertical" Margin="5,5,5,5"
x:Name="YearButtonsPanel" ButtonBase.Click="OnYearButtonClick" Grid.RowSpan="2">
<Button Content="2030"/>
<Button Content="2029"/>
<Button Content="2028"/>
<Button Content="2027"/>
<Button Content="2026"/>
<Button Content="2025"/>
<Button Content="2024"/>
<Button Content="2023"/>
</StackPanel>
<ScottPlot:WpfPlot x:Name="WpfPlot1" Grid.Column="0" Grid.Row="2"/>
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Vertical" Margin="5" Grid.ColumnSpan="2">
<StackPanel.Resources>
<Style x:Key="styleCalendar" TargetType="{x:Type Calendar}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Calendar}">
<!-- Wrapping in ViewBox will enlarge calendar of that size.-->
<Viewbox Height="300"
Width="300">
<CalendarItem x:Name="PART_CalendarItem"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"/>
</Viewbox>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</StackPanel.Resources>
<StackPanel Orientation="Horizontal" Margin="5">
<Label Content="时间:" VerticalAlignment="Center" Margin="5"/>
<DatePicker DisplayDate="" CalendarStyle="{StaticResource styleCalendar}" SelectedDate="{x:Static sys:DateTime.Now}"
VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Name="DpDate" Margin="5"/>
<StackPanel Orientation="Horizontal">
<RadioButton Name="rbMorning" Content="上午" Margin="5" VerticalAlignment="Center" VerticalContentAlignment="Center"/>
<RadioButton Name="rbAfternoon" Content="下午" Margin="5" IsChecked="True" VerticalAlignment="Center"/>
<RadioButton Name="rbEvening" Content="晚上" Margin="5" VerticalAlignment="Center"/>
</StackPanel>
<Label Content="地点:" VerticalAlignment="Center" Margin="5"/>
<StackPanel Orientation="Horizontal">
<RadioButton Name="rbPlace1" Width="100" Content="地点1" Margin="5" IsChecked="True" VerticalAlignment="Center"/>
<RadioButton Name="rbPlace2" Width="100" Content="地点2" Margin="5" VerticalAlignment="Center"/>
<RadioButton Name="rbPlace3" Width="50" Content="其他" Margin="5" VerticalAlignment="Center"/>
</StackPanel>
<TextBox Name="txtOtherPlace" Width="100" Text="" Margin="5" VerticalAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<Label Content="距离:" VerticalAlignment="Center" Margin="5"/>
<TextBox Name="TxtDistance" Width="50" Text="" VerticalContentAlignment="Center" HorizontalContentAlignment="Right" Margin="5"/>
<Label Content="公里" VerticalAlignment="Center" Margin="5"/>
<Label Content="时长:" VerticalAlignment="Center" Margin="5"/>
<TextBox Name="TxtDuration" Width="50" Text="" VerticalContentAlignment="Center" HorizontalContentAlignment="Right" Margin="5"/>
<Label Content="配速:" VerticalAlignment="Center" Margin="5"/>
<TextBox Name="TxtPace" Width="50" Text="" VerticalContentAlignment="Center" HorizontalContentAlignment="Right" Margin="5"/>
<Label Content="心率:" VerticalAlignment="Center" Margin="5"/>
<TextBox Name="TxtHeartRate" Width="50" Text="" VerticalContentAlignment="Center" HorizontalContentAlignment="Right" Margin="5"/>
<Label Content="最大摄氧量:" VerticalAlignment="Center" Margin="5"/>
<TextBox Name="TxtVO2Max" Width="50" Text="" VerticalContentAlignment="Center" HorizontalContentAlignment="Right" Margin="5"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" Margin="5" Grid.ColumnSpan="2">
<Button Name="BtnOk" Content="添加" Margin="30,5,5,5" Width="60" Click="BtnOk_OnClick"/>
<Button Name="BtnRevert" Content="撤销" Margin="30,5,5,5" Width="60" Click="BtnRevert_OnClick"/>
<Button Name="BtnPublish" Content="发布" Margin="30,5,5,5" Width="60" Click="BtnPublish_OnClick"/>
<Button Name="BtnGenerateLog" Content="拷贝跑步日志" Margin="30,5,5,5" Width="90" Click="BtnGenerateLog_OnClick"/>
<Button Name="BtnOpen" Content="打开数据目录" Margin="30,5,5,5" Width="90" Click="BtnOpen_OnClick"/>
</StackPanel>
</Grid>
</Grid>
</Window>