This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type TipCalculatorViewModel() as this = | |
inherit ViewModelBaseWithNavigation() | |
// Create our backing fields | |
let subTotal = this.Factory.Backing(<@ this.SubTotal @>, 0.0) | |
let receiptTotal = this.Factory.Backing(<@ this.ReceiptTotal @>, 0.0) | |
let tipPercent = this.Factory.Backing(<@ this.TipPercent @>, 15.0) | |
// This is only used to disable the button | |
let handlePaymentCommand = this.Factory.CommandSyncChecked((fun _ -> ()), (fun _ -> false)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bindSliderValueChangedTwoWayConverter<'destType> (slider:Slider) (reactiveProperty:ReactiveProperty<'destType>) (converter: DataConverter<'destType, float>) = | |
let disposable1 = slider.ValueChanged |> Observable.map (fun (ea) -> (slider.Value)) | |
|> Observable.iter (fun value -> Debug.WriteLine("Slider:" + value.ToString())) | |
|> Observable.subscribe (fun value -> reactiveProperty.Value <- converter.ConvertBack value) | |
let disposable2 = reactiveProperty | |
|> Observable.iter (fun value -> Debug.WriteLine("Prop:" + value.ToString())) | |
|> Observable.subscribe (fun value -> slider.Value <- converter.Convert value) | |
new CompositeDisposable([ disposable1; disposable2 ]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace TestiOS | |
open System | |
open MonoTouch.UIKit | |
open MonoTouch.Foundation | |
open System | |
open System.ComponentModel | |
open Xamarin.Forms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace TestAndroid | |
open System | |
open System.ComponentModel | |
open Android.App | |
open Android.Content | |
open Android.OS | |
open Android.Runtime | |
open Android.Views |