Adit >
Developer Pages >
Porting to Phone 7
Porting To Phone 7
Issues for Developers
What we have found so far ..........
Positives
- The IDE is familiar
- It all seems to work
- You will be up and running quickly
Negatives
- You do not seem to be able to import projects from 2005/2008
- Support for earlier VB syntax is absent
- Consuming a web service is not quite the piece of cake it was in 2008
- File handling needs a bit of a re-think
- User controls are limited
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