I can't seem to bind correctly to Oxyplot in Xamarin. I had a read through multiple posts, but couldn't figure out what's wrong with my setup.
XAML
<ContentPage.BindingContext>
<local:MainViewModel />
</ContentPage.BindingContext>
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="500" />
</Grid.RowDefinitions>
<oxy:PlotView Grid.Row="0" Model="{Binding CandlestickPlotModel}" Background="Green"/>
</Grid>
</ContentPage.Content>
ViewModel
class MainViewModel
{
public PlotModel CandlestickPlotModel { get; set; }
public MainViewModel()
{
CandlestickPlotModel = new PlotModel();
CandlestickPlotModel.Title = "Title";
CandlestickPlotModel.Background = OxyColors.LightBlue;
}
}
When I run, I get a green box, but I would expect a light blue box if the binding would work. Can anyone see what's wrong with this code?