Print page
 Email this page
 
  Google


Enhanced with Snapshots

Adit > Developer Pages > Porting to Phone 7

Porting To Phone 7

Issues for Developers
What we have found so far ..........
Positives
Negatives
For Developers coming from a VB background
Once you have your Hello Phone 7 app up and running, you will no doubt want to progress
to more exciting things, and here are a few pointers that may help
Showing another form
Dim Work As String = "/mainpage.xaml"
NavigationService.Navigate(New Uri(Work, UriKind.Relative))

Passing data to another form
On the calling form

Dim Work As String = "/dayform.xaml?"
Work = Work + "UserID="
Work = Work + ThisUser.ToString
Work = Work + "&"
Work = Work + "EmpID="
Work = Work + ThisEmployee.ToString

NavigationService.Navigate(New Uri(Work, UriKind.Relative))
On the receiving form

ThisUser = NavigationContext.QueryString("UserID")
ThisEmployee = NavigationContext.QueryString("EmpID")

Simple file handling
Dim FileName As String = "kinfo.dat"
Dim store As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()

Try
Dim sw As StreamWriter = New StreamWriter(store.OpenFile(FileName, FileMode.Create, FileAccess.Write))
sw.WriteLine(Date.Now)
sw.Close()
Catch ex As IsolatedStorageException
MessageBox.Show(ex.Message)
End Try


Dim FileName As String = "kinfo.dat"
Dim Line As String
Dim store As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()

Try
Dim sw As StreamReader = New StreamReader(store.OpenFile(FileName, FileMode.Open, FileAccess.Read))
Line = sw.ReadLine
sw.Close()
Catch ex As IsolatedStorageException
MessageBox.Show(ex.Message)
End Try

Consuming a web service





Bookmark and Share