-
Notifications
You must be signed in to change notification settings - Fork 979
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
129 lines (126 loc) · 7.02 KB
/
MainWindow.xaml
File metadata and controls
129 lines (126 loc) · 7.02 KB
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
<Window x:Class="ExampleBrowser.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
Title="OxyPlot.WPF Example Browser"
Height="720" Width="1280" Icon="OxyPlot_64.png">
<Window.Resources>
<SolidColorBrush x:Key="HotItemBackground" Color="#e6f3f7"/>
<SolidColorBrush x:Key="SelectedItemBorder" Color="#6dbdd1"/>
<SolidColorBrush x:Key="SelectedItemBackground" Color="#cbe6ef"/>
<SolidColorBrush x:Key="NormalItemBackground" Color="White"/>
<DrawingBrush x:Key="CheckerBoard" TileMode="Tile" ViewboxUnits="Absolute" Viewbox="0,0,2,2" Viewport="0,0,10,10" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="White">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,2,2" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="LightGray">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,1,1" />
<RectangleGeometry Rect="1,1,1,1" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<Style x:Key="ListboxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Background" Value="{StaticResource NormalItemBackground}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid>
<Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}"
StrokeThickness="{TemplateBinding BorderThickness}" RadiusX="3" RadiusY="3" SnapsToDevicePixels="True"/>
<ContentPresenter Margin="8,5" />
</Grid>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource HotItemBackground}" />
</MultiTrigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{StaticResource SelectedItemBackground}" />
<Setter Property="BorderBrush" Value="{StaticResource SelectedItemBorder}" />
<Setter Property="BorderThickness" Value="1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid Background="#20000000">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding ExamplesView}" ItemContainerStyle="{DynamicResource ListboxItemStyle}"
SelectedItem="{Binding SelectedExample}" BorderThickness="0,0,0,1">
<ListBox.GroupStyle>
<!-- GroupStyle with headers -->
<!--<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="Bold" Text="{Binding Name}" Padding="2 0 8 0"/>
<TextBlock Text="{Binding ItemCount, StringFormat='({0})'}" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>-->
<!-- GroupStyle with expanders -->
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Expander IsExpanded="False" ExpandDirection="Down">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="Bold" Text="{Binding Name}" Padding="0 0 8 0"/>
<TextBlock Text="{Binding ItemCount, StringFormat='({0})'}"/>
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListBox.GroupStyle>
</ListBox>
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="8">
<CheckBox IsChecked="{Binding MeasureFrameRate}" Content="Measure frame rate"/>
<TextBlock Margin="20 0 0 0" Text="{Binding FrameRate, StringFormat='{}{0:0.0} fps'}"/>
</StackPanel>
</Grid>
<TabControl Grid.Column="1" TabStripPlacement="Bottom">
<TabItem Header="Plot">
<oxy:PlotView x:Name="Plot1" Model="{Binding Model}" Controller="{Binding Controller}"/>
</TabItem>
<TabItem Header="Code">
<TextBox AcceptsReturn="True" FontFamily="Consolas"
Text="{Binding SelectedExample.Code, Mode=OneWay}" BorderThickness="0"
ScrollViewer.VerticalScrollBarVisibility="Auto"
/>
</TabItem>
</TabControl>
</Grid>
</Window>