Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unable to use certain classes from .NET #16870

Answered by vzarytovskii
Xyncgas asked this question in Q&A
Discussion options

Microsoft.AspNetCore.Components.NavigationOptions is available for F# through nuget package, yet attempting to construct the object in fsharp is impossible due to it looking like this

///<summary>
/// Additional options for navigating to another URI.
/// </summary>
[<Struct>]
type NavigationOptions =
 
 val ``<ForceLoad>k__BackingField`` : bool
 
 val ``<HistoryEntryState>k__BackingField`` : string
 
 val ``<ReplaceHistoryEntry>k__BackingField`` : bool
 
 ///<summary>
 /// If true, bypasses client-side routing and forces the browser to load the new page from the server, whether or not the URI would normally be handled by the client-side router.
 /// </summary>
 member ForceLoad: bool
 
 ///<summary>
 /// Gets or sets the state to append to the history entry.
 /// </summary>
 member HistoryEntryState: string
 
 ///<summary>
 /// If true, replaces the currently entry in the history stack.
 /// If false, appends the new entry to the history stack.
 /// </summary>
 member ReplaceHistoryEntry: bool

Making interop to blazor from F# really difficult all the sudden

You must be logged in to vote

You can, unless I'm missing something

Replies: 1 comment 1 reply

Comment options

You can, unless I'm missing something
image

You must be logged in to vote
1 reply
Comment options

You are correct. I used Visual Studio's intellisense to learn what I can do but I didn't know I can do it this way, it's my problem

I attempted to :

 let x = NavigationOptions()
 x.ForceLoad <- true

The initial impression I received for seeing an F# struct without mutable fields/properties and having no constructor shocked me

Answer selected by vzarytovskii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /