OfficeDev / Office-Add-in-samples

Code samples for Office Add-in development on the Microsoft 365 platform.
MIT License
671 stars 756 forks source link

Add Add-in Commands to the Ribbon to interop between JavaScript and C# with Blazor Pages. #762

Closed aafvstam closed 2 months ago

aafvstam commented 2 months ago
Q A
Bug fix? no
New feature? yes
New sample? no
Related issues? n/a

What's in this Pull Request?

Added sample code to show how to add Add-in Commands interacting with the Blazor Pages through the Office Ribbon. The sample shows how you can interop with the Blazor Pages from OfficeJS (Ribbon) to JavaScript to C# (Blazor Pages) and back to JavaScript.

Guidance

The guidance is in the ReadMe file. In short, we changed the Manifest to be able to run in Shared Runtime mode, and is using the Blazor/JavaScript Interop features from .NET Core to be able to run Blazor Page methods from the Office Ribbon.

aafvstam commented 2 months ago

Great @davidchesnut , thanks for the feedback. Will go over the suggestions and fix where possible!

aafvstam commented 2 months ago

@davidchesnut Added all changes according to your suggestions. Please review once more 😊