platform/wp7/rhodes/MainPage.xaml.cs in rhodes-2.4.1 vs platform/wp7/rhodes/MainPage.xaml.cs in rhodes-3.0.0.beta.1

- old
+ new

@@ -48,17 +48,27 @@ public MainPage() { InitializeComponent(); ApplicationTitle.Text = GetWinPhoneAttribute("Title"); + if (CRhoFile.isResourceFileExist("/apps/app/loading.png") == false) + { + LoadingImage.Visibility = Visibility.Collapsed; + webBrowser2.Visibility = Visibility.Visible; + } + else + webBrowser2.Visibility = Visibility.Collapsed; + + webBrowser1.Visibility = Visibility.Collapsed; webBrowser1.IsScriptEnabled = true; webBrowser1.Loaded += WebBrowser_OnLoaded; webBrowser1.LoadCompleted += WebBrowser_OnLoadCompleted; webBrowser1.Navigating += WebBrowser_OnNavigating; webBrowser1.Navigated += WebBrowser_OnNavigated; webBrowser1.ScriptNotify += WebBrowser_OnScriptNotify; + progressBar.IsIndeterminate = true; } private CRhodesApp RHODESAPP(){return CRhodesApp.Instance;} //private void Navigate(string url) @@ -72,10 +82,12 @@ //webBrowser1.InvokeScript("test_call3", "one"); } private void WebBrowser_OnLoaded(object sender, RoutedEventArgs e) { + if (webBrowser2.Visibility == Visibility.Visible) + webBrowser2.NavigateToString(CRhoFile.readStringFromResourceFile("/apps/app/loading.html")); RHODESAPP().Init(webBrowser1, this); } private void WebBrowser_OnLoadCompleted(object sender, NavigationEventArgs e) { @@ -89,9 +101,16 @@ e.Cancel = true; } private void WebBrowser_OnNavigated(object sender, NavigationEventArgs e) { + if (webBrowser1.Visibility == Visibility.Collapsed) + { + LoadingImage.Visibility = Visibility.Collapsed; + webBrowser2.Visibility = Visibility.Collapsed; + webBrowser1.Visibility = Visibility.Visible; + progressBar.Visibility = Visibility.Collapsed; + } RHODESAPP().addToHistory(e.Uri); } } } \ No newline at end of file