2016-06-14 4 views
0

次のコードで使用する識別子のタイプを決定する際に問題が発生しています。コードサンプルをMicrosoft UWP blogから取得しましたC++:どのタイプの識別子を使用するのですか?

しかし、私はそれを実装する方法を理解できないようですか? だから私はそれを正しく得るのを助けてください。おかげ

stackCount // is undefined in following code. 


void StartPage::OnNavigatedTo(NavigationEventArgs^ e) 
{ 
    auto rootFrame = dynamic_cast<Windows::UI::Xaml::Controls::Frame^>(Window::Current->Content); 

    Platform::String^ myPages = ""; 

    if (rootFrame == nullptr) 
     return; 

    for each (PageStackEntry^ page in rootFrame->BackStack) 
    { 
     myPages += page->SourcePageType.ToString() + "\n"; 
    } 

    stackCount->Text = myPages; // stackCount is undefined here 

    if (rootFrame->CanGoBack) 
    { 
     // If we have pages in our in-app backstack and have opted in to showing back, do so 
     Windows::UI::Core::SystemNavigationManager::GetForCurrentView()->AppViewBackButtonVisibility = 
     Windows::UI::Core::AppViewBackButtonVisibility::Visible; 
    } 
    else 
    { 
     // Remove the UI from the title bar if there are no pages in our in-app back stack 
     Windows::UI::Core::SystemNavigationManager::GetForCurrentView()->AppViewBackButtonVisibility = 
     Windows::UI::Core::AppViewBackButtonVisibility::Collapsed; 
    } 
} 
+0

これはC++ではなくC++/CLIです –

+0

エラーの正確な説明は何ですか? –

+0

stackCountは未定義です。 –

答えて

1

はおそらくstackCountサンプルがTextプロパティを設定することを指定されたマルチラインTextBlockあります。 XAMLページに追加してください。

+0

'stackCount'を' string'に変更しても問題ありません。 –

関連する問題