Windows Phone 8.1 EventArgs類總結(C#描述)——NavigationEventArgs類

來源:互聯網
上載者:User

標籤:

連結:https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.navigation.navigationeventargs(v=win.10).aspx

NavigationEventArgs類

為無法取消的導航事件及事件處理器函數所需的資料。該類直接繼承於Object類。

public sealed class NavigationEventArgs 

該類所具有的成員有:

名稱 訪問類型 類別 說明 延伸
Content 唯讀 屬性(properties) 擷取目標頁面的根節點  
NavigationMode 唯讀 屬性(properties) 導航時的移動方向 可能的取值:New、Back、Forward、Refresh。
NavigationTransitionInfo 唯讀 屬性(properties) 導航時的動畫類型
public class NavigationTransitionInfo : DependencyObject

 

Parameter 唯讀 屬性(properties) 傳遞的參數  
SourcePageType 唯讀 屬性(properties) 源頁面的資料類型  
Uri 讀寫 屬性(properties) 目標內容的Uri  

舉例:

 1 private void NavigateButton_Click(object sender, RoutedEventArgs e) 2 { 3     ProgressRing1.IsActive = true; 4  5     // Provide an indication as to where we are trying to navigate to 6     rootPage.NotifyUser(String.Format("Navigating to: {0}", Address.Text), NotifyType.StatusMessage); 7  8     // Hook the LoadCompleted event for the WebView to know when the URL is fully loaded 9     WebView1.LoadCompleted += new Windows.UI.Xaml.Navigation.LoadCompletedEventHandler(WebView1_LoadCompleted);10 11     // Attempt to navigate to the specified URL.  Notice that a malformed URL will raise a FormatException12     // which we catch and let the user know that the URL is bad and to enter a new well-formed one.13     try14     {15         Uri targetUri = new Uri(Address.Text);16         WebView1.Navigate(targetUri);17     }18     catch (FormatException myE)19     {20         // Bad address21         rootPage.NotifyUser(String.Format("Address is invalid, try again.  Details --> {0}", myE.Message), NotifyType.ErrorMessage);22     }23 }24 25 void WebView1_LoadCompleted(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)26 {27     WebView1.Visibility = Windows.UI.Xaml.Visibility.Visible;28     BlockingRect.Visibility = Windows.UI.Xaml.Visibility.Collapsed;29     ProgressRing1.IsActive = false;30 31     // Tell the user that the page has loaded32     rootPage.NotifyUser("Page loaded", NotifyType.StatusMessage);33 }34 35 void Address_KeyUp(object sender, KeyRoutedEventArgs e)36 {37     if (e.Key == Windows.System.VirtualKey.Enter)38     {39         NavigateButton_Click(this, new RoutedEventArgs());40     }41 }


待續

Windows Phone 8.1 EventArgs類總結(C#描述)——NavigationEventArgs類

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.