-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathMainWindow.axaml
More file actions
59 lines (57 loc) · 3.15 KB
/
MainWindow.axaml
File metadata and controls
59 lines (57 loc) · 3.15 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
<Window xmlns="https://github.com/avaloniaui"
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:oxy="http://oxyplot.org/avalonia"
xmlns:oxySkia="http://oxyplot.org/skiasharp/avalonia"
xmlns:oxySkiaDb="http://oxyplot.org/skiasharp/avalonia/doublebuffered"
xmlns:oxySkiaPr="http://oxyplot.org/skiasharp/avalonia/picturerecorder"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:exampleBrowser="clr-namespace:ExampleBrowser;assembly=ExampleBrowser"
xmlns:exampleLibrary="clr-namespace:ExampleLibrary;assembly=ExampleLibrary"
x:Class="ExampleBrowser.MainWindow"
Title="Example Browser">
<Window.DataContext>
<exampleBrowser:MainViewModel />
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<!-- The OxyPlot control is binding to a PlotModel in the MainViewModel -->
<ScrollViewer>
<ItemsControl ItemsSource="{Binding Categories}" Padding="0">
<ItemsControl.DataTemplates>
<DataTemplate DataType="exampleBrowser:Category">
<Expander Margin="0" Focusable="False">
<Expander.Header>
<TextBlock Text="{Binding Key}" DockPanel.Dock="Top" Margin="0" />
</Expander.Header>
<ListBox ItemsSource="{Binding Examples}" SelectedItem="{Binding $parent[Grid].DataContext.Example}" Margin="0" Padding="0">
<ListBox.DataTemplates>
<DataTemplate DataType="exampleLibrary:ExampleInfo">
<TextBlock Text="{Binding Title}" />
</DataTemplate>
</ListBox.DataTemplates>
</ListBox>
</Expander>
</DataTemplate>
</ItemsControl.DataTemplates>
</ItemsControl>
</ScrollViewer>
<Grid Grid.Column="1" RowDefinitions="*,auto">
<oxy:PlotView Model="{Binding CanvasModel}" IsVisible="{Binding CanvasModel, Converter={x:Static ObjectConverters.IsNotNull}}" />
<oxySkia:PlotView Model="{Binding SkiaSharpModel}" IsVisible="{Binding SkiaSharpModel, Converter={x:Static ObjectConverters.IsNotNull}}" />
<oxySkiaDb:PlotView Model="{Binding SkiaSharpDoubleBufferedModel}" IsVisible="{Binding SkiaSharpDoubleBufferedModel, Converter={x:Static ObjectConverters.IsNotNull}}" />
<oxySkiaPr:PlotView Model="{Binding SkiaSharpPictureRecorderModel}" IsVisible="{Binding SkiaSharpPictureRecorderModel, Converter={x:Static ObjectConverters.IsNotNull}}" />
<StackPanel Orientation="Horizontal" Grid.Row="1">
<TextBlock Text="Renderer:" VerticalAlignment="Center" Margin="5" />
<ComboBox ItemsSource="{Binding Renderers}" SelectedItem="{Binding SelectedRenderer}" />
</StackPanel>
</Grid>
</Grid>
</Window>