I use OxyPlot in my work to show some information. And I need to change the default tooltip which you can see after clicking on some point in the graph.
Currently, I have the test WPF window with a simple linear series. I've changed the template for the tooltip to display some text and button.
My controllers:
public class PlotViewTest : PlotView
{ }
public class TestTracker : TrackerControl
{
public TestTracker()
{
CanCenterHorizontally = false;
CanCenterVertically = false;
}
}
My WPF window code:
<controlers:PlotViewTest Model="{Binding MyModel}">
<controlers:PlotViewTest.DefaultTrackerTemplate>
<ControlTemplate>
<controlers:TestTracker Position="{Binding Position}">
<Grid Margin="15">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Margin="5" Text="Hello world!"/>
<Button Grid.Row="1" Margin="5" Content="Start"/>
</Grid>
</controlers:TestTracker>
</ControlTemplate>
</controlers:PlotViewTest.DefaultTrackerTemplate>
</controlers:PlotViewTest>
My WPF window:
But there are a few behaviors that I want to change.
- I can see the tooltip only when I hold down the left mouse button. When I up it the tooltip will be hidden. But I need to show tooltip always after 1 click of left mouse button on red point. When I click on the second red point another tooltip will be shown. But when I click in some empty space tooltip should be hidden.
- The tooltip also can be shown when I hold down the left mouse button on the blue line. But I want to prevent it. It should be shown only when I click on red points.
How can change these two behaviors??