Exception!
@1277201882 commented on Sun Aug 26 2018
In file ExpenseItHome.xaml.cs InitializeComponent() is wrong and give me an exception.
文档详细信息
⚠ 请勿编辑此部分。 docs.microsoft.com ➟ GitHub 问题链接必须具有此部分。
- ID: b0dc39f7-b153-a46c-3b88-07c8ed2c71bc
- Version Independent ID: 78a14535-9703-e2af-4451-783a7c4c10be
- Content: 在 Visual Studio 中创建一个 WPF 应用程序
- Content Source: docs/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application.md
- GitHub Login: @mairaw
- Microsoft Alias: mairaw
@imba-tjd commented on Sun Aug 26 2018
I can't reproduce it.
Hi Team,
Can you check on this issue reported by the user?
Thanks!
I can't reproduce it, either.
Hello, @1277201882
Can you provide us more information regarding the issue?
Thanks!
I think I'm running into the same issue. When I try to build and run the application per Step 8 of "Add an image and a title," the debugger throws an IOException saying it "Cannot locate resource 'watermark.png'. I assume I missed something in the earlier step when I added the image to the project but I don't know what that may be since there were only two seemingly straightforward steps.
FYI, the watermark.png file shows up under the Solution Items tab in the Solution Explorer after I added the image if that is relevant.
Resolved it. I clicked and dragged the watermark.png file from the Solution Items on the Solution Explorer and dropped it under the C# ExpenseIt item and the application ran without issues.
private void Button_Click(object sender, RoutedEventArgs e)
{
//View Expense Report
ExpenseReportPage expenseReportPage = new ExpenseReportPage(); //Line 1
this.NavigationService.Navigate(expenseReportPage); //Line 2
}
Line 2 in above code gives following error for NavigationService:
'<invalid-global-code' does not contain a definition for 'NavigationService' and no accessible extention method 'NavigationService' accepting the first argument of type '
I have added the using System.Windows.Navigation; I think the problem is coming from 'this' part of this.NavigationService.Navigate(expenseReportPage);
Please Help!
Thanks in advance.
The original issue was resolved. Closing.