Skip to content

How to use CPNowPlayingRepeatButton with action handler #15169

Description

@janwiebe-jump

It looks like the CarPlay button constructors are not correctly bound, because the constructor that takes an Action<CPNowPlayingButton> is not available.

Steps to Reproduce

  1. Add a using to CarPlay
  2. Try to create a CPNowPlayingRepeatButton with the Action parameter
new CPNowPlayingRepeatButton((h) => {});

Expected Behavior

Since the base class CPNowPlayingButton exposes the constructor with the handler (), the implementations should do it as well.

  • CPNowPlayingRepeatButton
  • CPNowPlayingPlaybackRateButton
  • CPNowPlayingMoreButton
  • CPNowPlayingAddToLibraryButton
  • CPNowPlayingShuffleButton

Is there a workaround possible by using the objc_msgSend?

Actual Behavior

The constructor that takes an action (like CPNowPlayingImageButton does) are not exposed

Environment

Version information
Microsoft Visual Studio Community 2022
Version 17.2.3
VisualStudio.17.Release/17.2.3+32526.322
Microsoft .NET Framework
Version 4.8.04161

Installed Version: Community

Visual C++ 2022   00476-80000-00000-AA906
Microsoft Visual C++ 2022

.NET Core Debugging with WSL   1.0
.NET Core Debugging with WSL

ASP.NET and Web Tools 2019   17.2.392.13739
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2012   17.2.392.13739
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   17.2.392.13739
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   17.2.392.13739
Azure Functions and Web Jobs Tools

C# Tools   4.2.0-4.22252.24+47cdc16a21bbb8a4aadfb666b011e2059e1be5d2
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fine Code Coverage   fcc-f339fe606-9d51-4fca-895c-d50375137b62
Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft SARIF Viewer   3.0.74.49387
Visual Studio Static Analysis Results Interchange Format (SARIF) log file viewer

Mono Debugging for Visual Studio   17.2.20 (482eb2a)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   6.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core)   17.0.0.2218101+885a343b00bcab620a90c1550c37dafd730ce984
Provides languages services for ASP.NET Core Razor.

ResX Resource Manager   ResXManager
Manage localization of all ResX-based resources in one place. Shows all resources of a solution and lets you edit the strings and their localizations in a well-arranged data grid.

SonarLint for Visual Studio   6.4.1.47693
SonarLint is an extension to your favorite IDE that provides on-the-fly feedback to developers on new bugs and quality issues injected into their code.

SQL Server Data Tools   17.0.62204.01010
Microsoft SQL Server Data Tools

TypeScript Tools   17.0.10418.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.2.0-4.22252.24+47cdc16a21bbb8a4aadfb666b011e2059e1be5d2
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   17.1.0-beta.22253.3+058e7a7e597a02c129f38742f250a4b212da9ee3
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Web Compiler   1.14.8
Compiler for LESS, Sass and CoffeeScript files

Xamarin   17.2.0.175 (d17-2@e4ffdc0)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.2.0.244 (remotes/origin/d17-2@197e1a0b7)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   17.2.15 (2e3b60e)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   12.3.0.3 (d17-2/bbba5a2)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: adf1bc4
    Java.Interop: xamarin/java.interop/d17-2@9760f0a9
    ProGuard: Guardsquare/proguard/v7.0.1@912d149
    SQLite: xamarin/sqlite/3.38.2@7b1e016
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-2@fc3c2ac


Xamarin.iOS and Xamarin.Mac SDK   15.10.0.1 (568bdb24e)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Build Logs

Example Project (If Possible)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIf an issue is a bug or a pull request a bug fix

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions