English 中文(简体)
∗∗∗∗∗
原标题:Detect mouse wheel over SKCanvasView

我在观看图像方面有MAUI应用。 图像使用SKCanvasView。 我想增加动物群功能,在窗户上,这些功能将使用 mo轮。 然而,我找不到这样做的途径。 接近我所期待的东西,似乎就是PinchGesture,但 mo轮 t却被翻译。 我发现,有些控制有<条码>点轮式轮./代码>活动,但<条码>SKCanvasView/代码>不是其中之一。 我也听到了为这一目的撰写习惯依赖服务和操作人员的情况,但没有实际实例说明这种摩擦。

I have a hunch that this is impossible in MAUI for now (unless I go really low level and tap into Windows APIs), but if someone knows a way how to make this work, I would appreciate it.

问题回答

You can add the PointerWheelChanged event to the windows platform view of the SKCanvasView. Such as:

在Xaml:

<sk:SKCanvasView x:Name="skview" HeightRequest="300" WidthRequest="300"/>

And in the page s code behind:

    protected override void OnHandlerChanged()
    {
        base.OnHandlerChanged();
#if WINDOWS
            var view = skview.Handler.PlatformView as SkiaSharp.Views.Windows.SKXamlCanvas;
            view.PointerWheelChanged += ( s, e) =>
            {

            };
#endif
      }

我对此进行了测试,并能够探测到SKCanvasView上的 mo轮。





相关问题
Unable to access file in ResourcesSounds folder

I m using .net Maui and attempting to create audioManager players for a couple of sound files located in the ResourcesSounds folder in the project. The code is this: var playerStartSound = ...

.NET MAUI native audio player

I am interested is there a way to play mp3 files from the phone internal memory using the built in native audio player. I am asking this, because I want to implement an equalizer too, so I am guessing ...

Integrating Push Notifications in MAUI .NET 7 Applications

I m developing a cross-platform application using MAUI .NET 7 and I would like to add push notification functionality to my application. I m considering using Firebase Cloud Messaging or Azure ...

Databinding doesnt work in my xaml.cs file

I am trying to load some data from my Model to the xaml.cs file. But it doesn t work. In my Mainpage.xaml i have a binding property inside a label. In the code behind file a BindingContext to my ...

Do some tasks after OnAppearing() in MAUI

I have a maui community toolkit expander control in my page. On Tapping the header the content is shown/hidden .I got a Maui map in the expander s content. It display properly if the expander is in ...

NET MAUI是否有可调整的分辨率特征?

页: 1 NET MAUI用于一个即将到来的项目,但我发现一件失踪的事情是,我需要的是分裂的特征。 我发现,散射器在移动上可能不会产生作用,但Im主要针对Windows......。

How to optimize detail page reset button in C# MAUI?

I ve implemented a Reset button on a Detail page in C# MAUI and it works, but I can t figure out why I need to be so explicit in the way I capture the initial data to perform the reset, when requested....

热门标签