Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Window
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.AlignedAxesDemo"
xmlns:oxy="http://oxyplot.org/avalonia"
x:Class="AvaloniaExamples.Examples.AlignedAxesDemo.MainWindow"
Title="AlignedAxesDemo" Height="480" Width="640">
Title="AlignedAxesDemo" Height="480" Width="640"
x:DataType="local:Context">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public partial class MainWindow : Window
public MainWindow()
{
this.InitializeComponent();
var models = new { Model0 = CreatePlotModel(0, 10), Model1 = CreatePlotModel(0, 1e8) };
var models = new Context(CreatePlotModel(0, 10), CreatePlotModel(0, 1e8));

// TODO: align the vertical axis size without setting PlotMargins
models.Model0.PlotMargins = models.Model1.PlotMargins = new OxyThickness(70, 40, 20, 20);
Expand All @@ -53,4 +53,6 @@ private static PlotModel CreatePlotModel(double min, double max)
return model;
}
}

internal record Context(PlotModel Model0, PlotModel Model1);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<UserControl xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:animationsdemo="using:AvaloniaExamples.Examples.AnimationsDemo"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
x:Class="AvaloniaExamples.Examples.AnimationsDemo.Controls.AnimationSettingsControl">
x:Class="AvaloniaExamples.Examples.AnimationsDemo.Controls.AnimationSettingsControl"
x:DataType="animationsdemo:AnimationViewModelBase">

<Grid>
<Grid.RowDefinitions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:AnimationsDemoViews="clr-namespace:AvaloniaExamples.Examples.AnimationsDemo.Views;assembly=AvaloniaExamples"
xmlns:local="using:AvaloniaExamples.Examples.AnimationsDemo"
xmlns:AnimationsDemoControls="clr-namespace:AvaloniaExamples.Examples.AnimationsDemo.Controls;assembly=AvaloniaExamples"
x:Class="AvaloniaExamples.Examples.AnimationsDemo.MainWindow"
Title="AnimationsDemo" Height="480" Width="740">
Expand All @@ -25,7 +26,7 @@
<AnimationsDemoViews:AreaSeriesView />
</TabItem>
</TabControl>
<ContentControl Grid.Row="1" DataContext="{Binding ElementName=tabControl, Path=SelectedItem.Content.DataContext}" >
<ContentControl Grid.Row="1" DataContext="{Binding #tabControl.((TabItem)SelectedItem).((Control)Content).DataContext}" >
<AnimationsDemoControls:AnimationSettingsControl />
</ContentControl>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<UserControl
xmlns="/avaloniaui"
xmlns:animationsdemo="using:AvaloniaExamples.Examples.AnimationsDemo"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:oxy="http://oxyplot.org/avalonia"
x:Class="AvaloniaExamples.Examples.AnimationsDemo.Views.AreaSeriesView"
>
x:DataType="animationsdemo:AreaSeriesViewModel">

<Grid>
<oxy:PlotView Model="{Binding PlotModel}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<UserControl
xmlns="/avaloniaui"
xmlns:animationsdemo="using:AvaloniaExamples.Examples.AnimationsDemo"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:oxy="http://oxyplot.org/avalonia"
x:Class="AvaloniaExamples.Examples.AnimationsDemo.Views.LineSeriesView"
>
x:DataType="animationsdemo:LineSeriesViewModel">

<Grid>
<oxy:PlotView Model="{Binding PlotModel}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<UserControl
xmlns="/avaloniaui"
xmlns:animationsdemo="using:AvaloniaExamples.Examples.AnimationsDemo"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:oxy="http://oxyplot.org/avalonia"
x:Class="AvaloniaExamples.Examples.AnimationsDemo.Views.LinearBarView"
>
x:DataType="animationsdemo:LinearBarViewModel">

<Grid>
<oxy:PlotView Model="{Binding PlotModel}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
xmlns:OxyPlot="clr-namespace:OxyPlot;assembly=OxyPlot"
xmlns:local="using:AvaloniaExamples.Examples.AnnotationDemo"
x:Class="AvaloniaExamples.Examples.AnnotationDemo.MainWindow"
Title="AnnotationDemo" Height="480" Width="640">
Title="AnnotationDemo" Height="480" Width="640"
x:DataType="local:Context">
<TabControl>
<TabItem Header="ArrowAnnotation">
<oxy:Plot Title="ArrowAnnotation">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public MainWindow()
{
new DataPoint(10, 10), new DataPoint(80, 30), new DataPoint(60, 70)
};
this.DataContext = new { Points };
this.DataContext = new Context(Points);
}

private void InitializeComponent()
Expand All @@ -42,4 +42,6 @@ private void InitializeComponent()
/// </summary>
public IList<DataPoint> Points { get; private set; }
}

internal record Context(IList<DataPoint> Points);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Window
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.AreaDemo"
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
x:Class="AvaloniaExamples.Examples.AreaDemo.MainWindow"
Title="AreaDemo" Height="480" Width="640">
Title="AreaDemo" Height="480" Width="640"
x:DataType="local:MainViewModel">
<DockPanel>
<oxy:Plot Title="LineSeries and AreaSeries">
<oxy:Plot.Legends>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Window
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.AxesDemo"
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
x:Class="AvaloniaExamples.Examples.AxesDemo.MainWindow"
Title="AxesDemo" Height="480" Width="640">
Title="AxesDemo" Height="480" Width="640"
x:DataType="local:MainViewModel">

<DockPanel>
<TabControl Margin="8">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Window
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.BarSeriesDemo"
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
x:Class="AvaloniaExamples.Examples.BarSeriesDemo.MainWindow"
Title="BarSeriesDemo" Height="480" Width="640">
Title="BarSeriesDemo" Height="480" Width="640"
x:DataType="local:Context">
<TabControl>
<TabItem Header="Binding to PlotModel">
<oxy:PlotView Model="{Binding Model1}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public MainWindow()
tmp.Series.Add(new BarSeries { Title = "2011", ItemsSource = items, ValueField = "Value3" });
tmp.Series.Add(new BarSeries { Title = "2012", ItemsSource = items, ValueField = "Value4" });

this.DataContext = new { Model1 = tmp, Items = items };
this.DataContext = new Context(tmp, items);

this.InitializeComponent();
}
Expand All @@ -66,4 +66,6 @@ public class Item : BarItem
public double Value3 { get; set; }
public double Value4 { get; set; }
}

internal record Context(PlotModel Model1, Collection<Item> Items);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Window
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.BindingDemo"
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
x:Class="AvaloniaExamples.Examples.BindingDemo.MainWindow"
Title="BindingDemo" Width="640"
Height="480">
Height="480"
x:DataType="local:MainViewModel">
<Grid>
<oxy:Plot Title="Binding ItemsSource" Subtitle="{Binding Subtitle}">
<oxy:Plot.Series>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Window
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.BindingObservableCollectionDemo"
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
x:Class="AvaloniaExamples.Examples.BindingObservableCollectionDemo.MainWindow"
Title="BindingDemo" Width="640"
Height="480">
Height="480"
x:DataType="local:MainViewModel">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial class MainWindow : Avalonia.Controls.Window
public MainWindow()
{
this.InitializeComponent();
var vm = new BindingObservableCollectionDemo.MainViewModel();
var vm = new MainViewModel();
this.DataContext = vm;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Window
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.BoxPlotSeriesDemo"
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
x:Class="AvaloniaExamples.Examples.BoxPlotSeriesDemo.MainWindow"
Title="BoxPlotSeriesDemo"
Width="640"
Height="480">
Height="480"
x:DataType="local:Context">
<TabControl>
<TabItem Header="Binding to PlotModel">
<oxy:PlotView Model="{Binding Model1}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ public MainWindow()
// Add the series, note that the BarSeries are using the same ItemsSource as the CategoryAxis.
tmp.Series.Add(new BoxPlotSeries { Title = "Values", ItemsSource = items, Fill = Colors.LightBlue.ToOxyColor() });

this.DataContext = new { Model1 = tmp, Items = items };
this.DataContext = new Context(tmp, items);
}

private void InitializeComponent()
{
Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(this);
}
}

internal record Context(PlotModel Model1, Collection<BoxPlotItem> Items);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns:oxy="http://oxyplot.org/avalonia"
xmlns:ColorBindingDemo="clr-namespace:AvaloniaExamples.Examples.ColorBindingDemo;assembly=AvaloniaExamples"
x:Class="AvaloniaExamples.Examples.ColorBindingDemo.MainWindow"
Title="ColorBindingDemo" Height="480" Width="640">
Title="ColorBindingDemo" Height="480" Width="640"
x:DataType="ColorBindingDemo:MainViewModel">
<Window.DataContext>
<ColorBindingDemo:MainViewModel/>
</Window.DataContext>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Window
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.ContextMenuDemo"
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
x:Class="AvaloniaExamples.Examples.ContextMenuDemo.MainWindow"
Title="ContextMenuDemo" Height="480" Width="640">
Title="ContextMenuDemo" Height="480" Width="640"
x:DataType="local:MainWindow">
<oxy:PlotView Model="{Binding Model}">
<oxy:PlotView.ContextMenu>
<ContextMenu>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Window xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.ContourDemo"
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
x:Class="AvaloniaExamples.Examples.ContourDemo.MainWindow"
Title="ContourDemo" Height="480" Width="640">
Title="ContourDemo" Height="480" Width="640"
x:DataType="local:MainViewModel">
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="File">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
xmlns:local="clr-namespace:AvaloniaExamples.Examples.ControllerDemo;assembly=AvaloniaExamples"
x:Class="AvaloniaExamples.Examples.ControllerDemo.MainWindow"
Title="OxyPlot Controller Demo" Height="480" Width="640">
Title="OxyPlot Controller Demo" Height="480" Width="640"
x:DataType="local:MainViewModel">
<Window.DataContext>
<local:MainViewModel />
</Window.DataContext>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public MainWindow()
private void InitializeComponent()
{
Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(this);

}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Window
xmlns="/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AvaloniaExamples.Examples.CoupledAxesDemo"
xmlns:oxy="http://oxyplot.org/avalonia"
x:Class="AvaloniaExamples.Examples.CoupledAxesDemo.MainWindow"
Title="CoupledAxesDemo" Height="480" Width="640">
Title="CoupledAxesDemo" Height="480" Width="640"
x:DataType="local:MainWindow">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
Expand Down
Loading