HyperlinkButton——WP8控件学习
頁(yè)面代碼:
<Grid x:Name="LayoutRoot" Background="Transparent">
? ? ? ? <Grid.RowDefinitions>
? ? ? ? ? ? <RowDefinition Height="Auto"/>
? ? ? ? ? ? <RowDefinition Height="*"/>
? ? ? ? </Grid.RowDefinitions>
? ? ? ? <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
? ? ? ? ? ? <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
? ? ? ? ? ? <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
? ? ? ? </StackPanel>
? ? ? ? <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
? ? ? ? ? ? <!--創(chuàng)建一個(gè)HyperlinkButton按鈕-->
? ? ? ? ? ? <HyperlinkButton Width="200" Height="30"?
? ? ? ? ? ? ? ? ?Content="鏈接按鈕"?
? ? ? ? ? ? ? ? ?Background="Blue" Foreground="Orange"?
? ? ? ? ? ? ? ? ?FontWeight="Bold" Margin="-12,19,268,558">
? ? ? ? ? ? </HyperlinkButton>
? ? ? ? ? ? <!--點(diǎn)擊Google按鈕,將會(huì)跳轉(zhuǎn)到ie并打開(kāi)網(wǎng)頁(yè)http://baidu.com-->
? ? ? ? ? ? <HyperlinkButton Content="baidu" NavigateUri="http://baidu.com" TargetName="_blank" Margin="12,72,342,486" />
? ? ? ? ? ? <!--點(diǎn)擊Page1頁(yè)面按鈕,將會(huì)跳轉(zhuǎn)到Page1.xaml頁(yè)面-->
? ? ? ? ? ? <HyperlinkButton Width="142" Height="47" x:Name="HomeLink"?
? ? ? ? ? ? ? ? ? ? Content="Page1頁(yè)面" Foreground="Yellow"?
? ? ? ? ? ? ? ? ? ? ?FontWeight="Bold" HorizontalAlignment="Left" Margin="6,127,0,0"?
? ? ? ? ? ? ? ? ? ? ?VerticalAlignment="Top" NavigateUri="/Page1.xaml" />
? ? ? ? </Grid>
? ? </Grid>
運(yùn)行效果:
總結(jié):控件多了一個(gè)NavigateUri屬性?
總結(jié)
以上是生活随笔為你收集整理的HyperlinkButton——WP8控件学习的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 通过点击热区,有个href 跳到serv
- 下一篇: 一个简单json数据提交实例