Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting the backing classes for UI elements #342

Merged
merged 4 commits into from
Feb 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/views-extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,21 @@ need not be added, you can set them on elements using the helper `With`, usable
View.Map(hasZoomEnabled = true, hasScrollEnabled = true).With(horizontalOptions = LayoutOptions.FillAndExpand)
```

### Example: MasterDetailPage without a toolbar on UWP with custom ViewBuilders

Fabulous uses ViewBuilders to create the underlying Xamarin.Forms classes. Customizing ViewBuilders is not the recommended way for custom controls but it is a great solution for overridden controls like in the following example:

```fsharp
type MasterDetailPageWithoutToolbar() =
inherit Xamarin.Forms.MasterDetailPage()
override __.ShouldShowToolbarButton() = false

Fabulous.DynamicViews.ViewBuilders.CreateFuncMasterDetailPage <- fun () ->
upcast(new MasterDetailPageWithoutToolbar())

View.MasterDetailPage() // this now uses MasterDetailPageWithoutToolbar
```

See also:

* [Core Elements](views-elements.md)
Expand Down
Loading