WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 1b8d347

Browse files
authored
Merge pull request #190 from reactivemarbles/AddNet10
Update workflows and LiveChart initialization
2 parents a624322 + fc6b550 commit 1b8d347

File tree

4 files changed

+20
-39
lines changed

4 files changed

+20
-39
lines changed

.github/workflows/BuildDeploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ jobs:
6767
vs update release Enterprise
6868
vs modify release Enterprise +mobile +desktop +uwp +web
6969
vs where release
70-
71-
- name: 'Install DotNet workloads'
70+
71+
- name: 'Install DotNet workloads (explicit)'
7272
shell: bash
7373
run: |
74-
dotnet workload install android ios tvos macos maui maccatalyst wasm-tools wasm-tools-net8
74+
dotnet workload install android ios tvos macos maui maccatalyst wasm-tools wasm-tools-net8 wasm-tools-net9 || true
7575
7676
- name: NBGV
7777
id: nbgv
@@ -89,7 +89,7 @@ jobs:
8989
~/.nuget/packages
9090
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
9191

92-
- name: 'Run: Compile Pack'
92+
- name: 'Run: Compile and Pack'
9393
run: ./build.cmd Pack
9494
env:
9595
NuGetApiKey: ${{ secrets.NUGET_API_KEY }}

.github/workflows/BuildOnly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ jobs:
6363
vs modify release Enterprise +mobile +desktop +uwp +web
6464
vs where release
6565
66-
- name: 'Install DotNet workloads'
66+
- name: 'Install DotNet workloads (explicit)'
6767
shell: bash
6868
run: |
69-
dotnet workload install android ios tvos macos maui maccatalyst wasm-tools wasm-tools-net8
69+
dotnet workload install android ios tvos macos maui maccatalyst wasm-tools wasm-tools-net8 wasm-tools-net9 || true
7070
7171
- name: NBGV
7272
id: nbgv

global.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"sdk": {
3-
"version": "10.0.100-rc.2.25502.107",
4-
"rollForward": "latestFeature",
5-
"allowPrerelease": true
6-
}
2+
"sdk": {
3+
"version": "10.0.100-rc.2.25502.107",
4+
"rollForward": "latestFeature",
5+
"allowPrerelease": true
6+
}
77
}

src/CrissCross.WPF.Plot/Views/LiveChart.xaml.cs

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using System.Windows.Media;
1414
using CP.WPF.Controls;
1515
using ReactiveUI;
16-
using ReactiveUI.SourceGenerators;
1716
using ScottPlot;
1817
using ScottPlot.Plottables;
1918

@@ -22,9 +21,8 @@ namespace CrissCross.WPF.Plot;
2221
/// <summary>
2322
/// Interaction logic for WPF Chart AICS.
2423
/// </summary>
25-
[IViewFor<LiveChartViewModel>]
2624
[SupportedOSPlatform("windows10.0.19041")]
27-
public partial class LiveChart
25+
public partial class LiveChart : ReactiveUI.ReactiveUserControl<LiveChartViewModel>
2826
{
2927
private readonly CompositeDisposable _dd = [];
3028
private IDisposable? _crosshairDisposable;
@@ -37,17 +35,17 @@ public partial class LiveChart
3735
private AxisLine? _plottableBeingDragged;
3836

3937
/// <summary>
40-
/// Initializes a new instance of the <see cref="LiveChart" /> class.
38+
/// Initializes a new instance of the <see cref="LiveChart"/> class.
4139
/// </summary>
4240
public LiveChart()
4341
{
4442
InitializeComponent();
4543
First = false;
46-
DataContext = ViewModel = new(MainChartGrid) { UseFixedNumberOfPoints = UseFixedNumberOfPoints, NumberPointsPlotted = NumberPointsPlotted };
44+
ViewModel = new(MainChartGrid) { UseFixedNumberOfPoints = UseFixedNumberOfPoints, NumberPointsPlotted = NumberPointsPlotted };
45+
DataContext = ViewModel;
4746
ViewModel.ThrownExceptions.Subscribe(ex => Debug.WriteLine($"Exception in LiveChart: {ex.Message}")).DisposeWith(_dd);
4847
ExecuteLockUnlock();
4948
ExecuteManAutoScale();
50-
5149
InitializeButtons();
5250
this.WhenActivated(ElementBinding1);
5351
}
@@ -580,46 +578,29 @@ private void MainChartGrid_MouseUp(object sender, MouseEventArgs e)
580578

581579
private void MainChartGrid_MouseMove(object sender, MouseEventArgs e)
582580
{
583-
////this rectangle is the area around the mouse in coordinate units
584-
// MOUSE EVENT
585581
var position = e.GetPosition(MainChartGrid);
586-
587-
// Obtener el DPI Scaling del Grid actual
588582
var dpiInfo = VisualTreeHelper.GetDpi(MainChartGrid);
589-
var dpiScaleX = dpiInfo.DpiScaleX;
590-
var dpiScaleY = dpiInfo.DpiScaleY;
591-
592-
// Ajustar las coordenadas para que sean precisas
593-
var adjustedX = position.X * dpiScaleX;
594-
var adjustedY = position.Y * dpiScaleY;
595-
596-
//// determine where the mouse is and send the coordinates
597-
////Pixel mousePixel = new(adjustedX, adjustedY);
598-
////var mouseLocation = ViewModel.WpfPlot1vm!.Plot.GetCoordinates(mousePixel, ViewModel!.XAxis1, ViewModel.YAxisList[0]);
599-
////var xAxe = mouseLocation.X;
600-
////var yAxe = mouseLocation.Y;
583+
var adjustedX = position.X * dpiInfo.DpiScaleX;
584+
var adjustedY = position.Y * dpiInfo.DpiScaleY;
601585
var rect = ViewModel!.WpfPlot1vm!.Plot.GetCoordinateRect((float)adjustedX, (float)adjustedY, radius: 5, ViewModel!.XAxis1, ViewModel.YAxisList[0]);
602-
603586
if (_plottableBeingDragged is null)
604587
{
605-
////set cursor based on what's beneath the plottable
606588
var lineUnderMouse = ViewModel.GetLineUnderMouse((float)adjustedX, (float)adjustedY);
607589
if (lineUnderMouse is null)
608590
{
609-
Cursor = Cursors.Arrow;
591+
System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow;
610592
}
611593
else if (lineUnderMouse.IsDraggable && lineUnderMouse is VerticalLine)
612594
{
613-
Cursor = Cursors.SizeWE;
595+
System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.SizeWE;
614596
}
615597
else if (lineUnderMouse.IsDraggable && lineUnderMouse is HorizontalLine)
616598
{
617-
Cursor = Cursors.SizeNS;
599+
System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.SizeNS;
618600
}
619601
}
620602
else
621603
{
622-
// update the position of the plottable being dragged
623604
if (_plottableBeingDragged is HorizontalLine hl)
624605
{
625606
hl.Y = rect.VerticalCenter;

0 commit comments

Comments
 (0)