2009年2月10日

Silverlight Hyperlink

在 Silverlight 中,可以使用 HyperlinkButton,來連結到其他的網頁。 example: <HyperlinkButton Content="Click Me" NavigateUri="http://www.silverlight.net" / > 同時,可以利用 TargetName="_self" 與 "_blank" 來決定以目前或新的視窗來顯示連結網頁。 example: <HyperlinkButton Content="Click Me" TargetName="_blank" NavigateUri="http://www.silverlight.net" / > 如果要以圖片或其他的形狀來呈現連結,可以參考下列的範例。 example: <HyperlinkButton NavigateUri="http://www.silverlight.net"> <HyperlinkButton.Content> <Canvas> <Rectangle Width="100" Height="100" Fill="Black" Stroke="Blue" StrokeThickness="2" / > <TextBlock Canvas.Top="40" Canvas.Left="25">Click Me</TextBlock> </Canvas> </HyperlinkButton.Content> </HyperlinkButton> 如果是在程式中,要連接到其他網頁,則可以透過 Navigate 來處理 example: HtmlPage.Window.Navigate(new Uri(uri), "_blank"); [reference] http://silverlight.net/blogs/msnow/archive/2008/10/16/silverlight-tip-of-the-day-62-how-to-create-a-hyperlink.aspx http://msdn.microsoft.com/zh-tw/library/system.windows.controls.hyperlinkbutton.targetname(VS.95).aspx

沒有留言:

Deploying Vue & .NET with Google OAuth on GCP Cloud Run

Deploying Vue & .NET with Google OAuth on GCP Cloud Run Deploying Vue & .NET with Google OAuth on GCP Cloud Run...