Advertisement
Guest User

Untitled

a guest
Jul 4th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 1.00 KB | None | 0 0
  1. type MainViewModel() as self =
  2.     inherit ViewModelBase()  
  3.  
  4.     let sDate = self.Factory.Backing(<@ self.startDate @>, "")
  5.     let display = self.Factory.Backing(<@ self.Display @>, "")
  6.  
  7.     let submitQuery() =
  8.  
  9.         let starttime = sDate.Value
  10.         let fullURL = "http://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=" + starttime + "&orderby=magnitude-asc"
  11.  
  12.         let eqlist = EQ.Load(fullURL)
  13.  
  14.         let inputData = eqlist.ToString()
  15.         let addLine (inputData : string) =
  16.             use sw = new StreamWriter("temp.json", false)
  17.             sw.WriteLine(inputData)
  18.         addLine inputData
  19.  
  20.         display.Value <- sprintf "The start date that has been enter is:\n %s" starttime
  21.  
  22.     let submitCommand = self.Factory.CommandSync(submitQuery)
  23.  
  24.     member x.startDate with get() = sDate.Value and set value = sDate.Value <- value
  25.     member x.Display with get() = display.Value and set value = display.Value <- value
  26.     member x.onSubmit = submitCommand
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement