Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove example library code (use nupkg instead) #7

Merged
merged 4 commits into from
Nov 28, 2023

Conversation

janusw
Copy link
Member

@janusw janusw commented Nov 26, 2023

The sample project in this repo includes an example browser, which is based on the example library at https://github.com/oxyplot/oxyplot/tree/develop/Source/Examples/ExampleLibrary. However the example-library code has been copied into this repository, which is not a good idea IMHO (it is outdated already and does not include the latest samples, and this will get worse over time).

Therefore this PR removes the ExampleLibrary code from the repository and uses the corresponding nupkg instead. For this to work I had to revert one commit (efee33c) by @iniceice88, which made some modifications to the ExampleLibrary (exposing ExampleInfo.Example and making ExampleInfo.Example.Controller settable). These modifications could either be upstreamed into https://github.com/oxyplot/oxyplot, or they could alternatively be included as a custom sample that is not part of the example library.

@iniceice88 Is this PR ok with you?

* and use a package reference instead of a project reference in OxyplotMauiSample
@iniceice88
Copy link
Collaborator

It's okay with me to use "nupkg" instead,

Actually, we do not have to set OxyPlot.Example.Controller, instead we can create custom PlotController in PlotViewPage.xaml.cs

/* PlotViewPage.xaml.cs PlotViewPage_Loaded event */

//if (ExampleInfo.PlotController != null)
//{
//    PlotView.Controller = ExampleInfo.PlotController;
//}

// make the annotation tooltip work
if (ExampleInfo.PlotController == null && ExampleInfo.Tags.Contains("Annotations"))
{
    PlotView.Controller = CreateAnnotationTrackController();
}
else
{
    PlotView.Controller = ExampleInfo.PlotController;
}

@janusw
Copy link
Member Author

janusw commented Nov 27, 2023

It's okay with me to use "nupkg" instead,

Thanks for the feedback!

Actually, we do not have to set OxyPlot.Example.Controller, instead we can create custom PlotController in PlotViewPage.xaml.cs

Very good point, that is even better than the options that I listed.

* this (partially) reverts commit 39b6141
* except for the changes in OxyPlot.Maui.Skia/Manipulators/TouchTrackerManipulator.cs,
  which are kept
* restore the AnnotationTrackController that was removed in efee33c
* but in a way that is compatible with the current ExampleLibrary (without modifications)
@janusw
Copy link
Member Author

janusw commented Nov 28, 2023

Actually, we do not have to set OxyPlot.Example.Controller, instead we can create custom PlotController in PlotViewPage.xaml.cs

Very good point, that is even better than the options that I listed.

I have added this in e44e2db, and verified that the tool tips in the sample "Annotations - Tool tips" work again (on Windows).

@janusw janusw merged commit f592982 into oxyplot:develop Nov 28, 2023
2 checks passed
@janusw janusw deleted the rm_xmpl_lib branch November 28, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants