2016-03-06 52 views
-1

我正在學習本教程以瞭解使用uwp,xaml進行對等頁面導航。信息是否正確。 tutorial_capture如何使用xaml,uwp和Visual Studio創建TextBlock和HyperlinkBut​​ton

結束標記沒有第一部分的開始標記。第二種類型是不知道的。我正在使用Visual Studio。 這裏是鏈接到的教程,代碼: link to tutorial

<Page 
x:Class="NavApp1.Page1" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:NavApp1" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d"> 

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
    <TextBlock x:Name="pageTitle" Text="Page 1" /> 
    </code> 
    </pre> 
    </td> 
    </tr> 
    </tbody> 
    </table> 
    <colgroup> 
     <col width="100%" /> 
    </colgroup> 
    <thead> 
     <tr class="header"> 
      <th align="left">XAML</th> 
     </tr> 
    </thead> 
    <tbody> 
     <tr class="odd"> 
      <HyperlinkButton HorizontalAlignment="Center" Content="Click to go to page 2" Click="HyperlinkButton_Click"/> 
      </code> 
      </pre> 
      </td> 
     </tr> 
    </tbody> 
    </table> 
</Grid> 

+0

您似乎正在查看[此頁](https://msdn.microsoft.com/en-us/windows/uwp/layout/peer-to-peer-navigation-between-two-pages)。它被打破。示例XAML與頁面的HTML混淆在一起。 – Clemens

回答

0

這顯然是暫時的破網站的代碼片段插件,以正確的方式來創建一個TextBlockHyperlinkButton XAML代碼是這樣的:

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
    <TextBlock x:Name="pageTitle" Text="Page 1" /> 
    <HyperlinkButton HorizontalAlignment="Center" Content="Click to go to page 2" Click="HyperlinkButton_Click"/> 
</Grid> 

看來你是新來UWP應用程序開發,開始有了它,你可以參考Create a "hello world" app in C++ (Windows 10)

另外這裏有一些官方Universal Windows app samples,你可以看看。

相關問題