Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Commit

Permalink
onboard F# sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig committed Jul 20, 2019
1 parent b365540 commit 983869f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Chapter02/FS/Greetings/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: 'Xamarin.Forms Book - Greetings F#'
description: "Simple Xamarin.Forms application written in F# #getstarted"
description: "Simple Xamarin.Forms app written in F# #getstarted"
page_type: sample
languages:
- fsharp
Expand Down
2 changes: 1 addition & 1 deletion Chapter02/FS/Hello/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: 'Xamarin.Forms Book - Hello F#'
description: "Simple Xamarin.Forms application written in F# #getstarted"
description: "Simple Xamarin.Forms app written in F# #getstarted"
page_type: sample
languages:
- fsharp
Expand Down
31 changes: 31 additions & 0 deletions Chapter03/FS/VariableFormText/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: 'Xamarin.Forms Book - VariableFormattedText F#'
description: "Xamarin.Forms app with formatted text spans, written in F#"
page_type: sample
languages:
- fsharp
products:
- xamarin
urlFragment: chapter03-fs-variableformtext
---
# Greetings F\#

Simple Xamarin.Forms application written in F#, showing formatted text spans:

```fsharp
type VariableFormattedTextPage() =
inherit ContentPage()
let formattedString = FormattedString()
let largeSize = Device.GetNamedSize(NamedSize.Large, typeof<Label>)
do formattedString.Spans.Add(Span(Text = "I "))
do formattedString.Spans.Add(Span(Text = "love",
FontSize = largeSize,
FontAttributes = FontAttributes.Bold))
do formattedString.Spans.Add(Span(Text = " Xamarin.Forms"))
do base.Content <- Label(FormattedText = formattedString,
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center,
FontSize = largeSize)
```

0 comments on commit 983869f

Please sign in to comment.