134 lines
7.9 KiB
XML
134 lines
7.9 KiB
XML
<Window x:Class="ExampleBrowser.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:oxyWpf="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
|
|
xmlns:oxySkia="clr-namespace:OxyPlot.SkiaSharp.Wpf;assembly=OxyPlot.SkiaSharp.Wpf"
|
|
xmlns:local="clr-namespace:ExampleBrowser"
|
|
Title="OxyPlot.WPF Example Browser"
|
|
Height="720" Width="1280" Icon="OxyPlot_64.png">
|
|
<Window.DataContext>
|
|
<local:MainWindowViewModel />
|
|
</Window.DataContext>
|
|
<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">
|
|
<ListBox ItemsSource="{Binding ExamplesView}" ItemContainerStyle="{DynamicResource ListboxItemStyle}"
|
|
SelectedItem="{Binding SelectedExample}" BorderThickness="0,0,0,1">
|
|
<ListBox.GroupStyle>
|
|
<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>
|
|
</Grid>
|
|
<Grid Grid.Column="1">
|
|
<TabControl TabStripPlacement="Bottom">
|
|
<TabControl.Resources>
|
|
<Style TargetType="{x:Type TextBox}" x:Key="CodeTextBox">
|
|
<Setter Property="AcceptsReturn" Value="True"></Setter>
|
|
<Setter Property="FontFamily" Value="Consolas"></Setter>
|
|
<Setter Property="BorderThickness" Value="0"></Setter>
|
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"></Setter>
|
|
</Style>
|
|
</TabControl.Resources>
|
|
<TabItem Header="Plot">
|
|
<Grid>
|
|
<Grid.Resources>
|
|
<local:NotNullVisibilityConverter x:Key="NotNullVisibilityConverter" />
|
|
</Grid.Resources>
|
|
<oxySkia:PlotView Model="{Binding SkiaModel}" Controller="{Binding SelectedExample.PlotController}" Visibility="{Binding SkiaModel, Converter={StaticResource NotNullVisibilityConverter}}" />
|
|
<oxyWpf:PlotView Model="{Binding CanvasModel}" Controller="{Binding SelectedExample.PlotController}" Visibility="{Binding CanvasModel, Converter={StaticResource NotNullVisibilityConverter}}" />
|
|
<local:XamlPlotView Model="{Binding CanvasXamlModel}" Controller="{Binding SelectedExample.PlotController}" Visibility="{Binding CanvasXamlModel, Converter={StaticResource NotNullVisibilityConverter}}" />
|
|
</Grid>
|
|
</TabItem>
|
|
<TabItem Header="Code">
|
|
<TextBox Text="{Binding Code, Mode=OneWay}" Style="{StaticResource CodeTextBox}" />
|
|
</TabItem>
|
|
</TabControl>
|
|
<StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Right" Orientation="Horizontal">
|
|
<TextBlock Text="Renderer:" VerticalAlignment="Center" />
|
|
<ComboBox SelectedItem="{Binding Renderer}" ItemsSource="{Binding Renderers}" Margin="3,0,0,0" Width="80" />
|
|
<CheckBox IsChecked="{Binding Transposed}" Content="Transposed" VerticalAlignment="Center" Margin="10,0,5,0" IsEnabled="{Binding CanTranspose}" />
|
|
<CheckBox IsChecked="{Binding Reversed}" Content="Reversed" VerticalAlignment="Center" Margin="10,0,5,0" IsEnabled="{Binding CanReverse}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Window>
|