MicrosoftDocs / windows-dev-docs

Conceptual and overview content for developing Windows apps
Creative Commons Attribution 4.0 International
682 stars 1.19k forks source link

this doesn't work at all with VS2022 #3680

Closed TommyNorthAL closed 2 years ago

TommyNorthAL commented 2 years ago

this is what is in MainPage.xaml to start: <Page x:Class="HelloWorldCppWinRT.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:HelloWorldCppWinRT" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>

</Grid>

if you paste in the text given in step 1 to create the form, it just blurs with errors. Doesn't recognize any of the symbols. I followed the instructions to create the project, I believe.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Karl-Bridge-Microsoft commented 2 years ago

Hi @TommyNorthAL - The MainPage.xaml file created in a new Blank App (C++/WinRT) template project, does not contain a element. Looks like you might've missed a step or two.

Make sure you've got your dev environment set up correctly and follow the steps as outlined.

Here's the initial code you should see for which step one asks you to replace the element:

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

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
    <Button x:Name="myButton" Click="ClickHandler">Click Me</Button>
</StackPanel>