Why does NavigationService in Silverlight / WP7 use strings over classes?

Given that C # tends to be more of a strongly typed language, why did designers choose URI-based navigation across classes?

NavigationService.Navigate(new Uri("/MyPage.xaml", UriKind.Relative)) 

does not work at runtime if MyPage is missing.

If there was a method supporting passing PhoneApplicationPage as an argument, for example

NavigationService.Navigate(new MyPage()); 

Errors related to navigation can be detected at compile time.

Why is this not an integral design in Silverlight / WP7?

+5
source share
5 answers

Silverlight ( WPF). : not String, URI. : , XAML, , . , - URI . , URI, , "" , , , , ..

, , - ( ), . , URI , (, , ..), ( a.k.a.). Windows Phone 7 ( , , "" ..), Silverlight ( Silverlight SDK), , Windows Phone .

, URI - - . , .

+1

WP7 dev , , , . , - . Web Silverlight . , . , Silverlight WP7, , .

, , -, - - -. - . , -, URL- , WP7 NavigationService. Silverlight, WP7, .

, , , , , . , , ( ), ( OnNavigatedTo, ) ( ). , 7.5 8, .

+3

Silverlight/WP7 , , ViewModel/View. :

+1

Caliburn Micro (MVVM framework) , ViewModels - " , "

+1

, Silverlight URL- .xaml . , Silverlight , URL- .

, , (, ) - http.

0
source

All Articles