none
Problems creating the ExpenseIt tutorial

    Question

  • I'm new to both Visual Studio 2019 and C# language.  When following the ExpenseIt getting started tutorial Step 1. Create a new WPE Application does not create the App.xaml (c#) file ask to be selected in Step 2.  What I see is MainWindow.xaml and MainWindow.xaml.cs but I don't see the App.xaml. To new to say any thing but help.  Searched in forum for ExpenseIt, but found no listings about what I'm seeing.  Thanks, Doug


    Friday, May 17, 2019 4:11 PM

Answers


  • Hi   Doug.Kennedy,

    You may refer the following toturial to create a WPF Application.

    Walkthrough: My first WPF desktop application

    I also tried on my side( Vsiaul Studio 2019, C#). When I create a new WPE Application it also create the App.xaml (c#) file. 

    >>Which is puzzling as that is what step 2 is indicating should happen.

    App.xaml is the declarative starting point of your application. Visual Studio will automatically create it for you when you start a new WPF application. This class extends the Application class, allowing us to do stuff on the application level. 

    The App.Xaml defines any application resources. You also use this file to specify the UI, in this case MainWindow.xaml, that automatically shows when the application starts.

    StartupUri="MainWindow.xaml"

    You can refer the WPF-Samples :  Which contains the samples that demonstrate the API usage patterns and popular features for the Windows Presentation Foundation in the .NET Framework for Desktop.


    Best Regards

    Yong Lu





    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Doug.Kennedy Monday, May 20, 2019 8:39 PM
    Monday, May 20, 2019 5:48 AM
    Moderator

All replies

  • Your component list is not showing all the files.  On the toolbar above the component list there is a "Show all Files" button.  Just hover above the buttons to see it.  After you click it all will be revealed.

    Lloyd Sheen

    Friday, May 17, 2019 4:27 PM
  • Thanks, Lloyd... I found the Show all files button in the Solution Explorer. Your help is greatly appreciated. When you get there have a great weekend.  Doug
    Friday, May 17, 2019 5:02 PM
  • Step 2. Says Open App.xaml (C#). Your XAML should look like the following in C#:

    <Application x:Class="ExpenseApp" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> <Application.Resources> </Application.Resources> </Application>

    The App.xaml does not appear in the same line as the other files;

    such as MainWindow.xaml or MainWindow.xaml.cs

    When Right clicking and selecting view code on App.xaml within Solution Explorer the App.xaml.cs code is displayed not the code identified in the Step 2 of the tutorial.

    If I right click and select view Designer it says App.xaml cannot be edited in the Design view.

    Which is puzzling as that is what step 2 is indicating should happen.

    Regret being so lost.

    Appreciate the forum's help. Thanks, Doug


    Friday, May 17, 2019 5:38 PM
  • I'm not so sure that learning wpf based solely on a sample off the web is an ideal plan.

    There is a huge amount to learn.

    .

    You don't edit app.xaml in the designer.

    It's not that sort of a file.

    You use it to do stuff like define the starting window.

    But mainly, for resources.

    The usual approach is to create resource dictionaries and then merge them in app.xaml.

    Resource dictionaries have your styling, templating, iconography and whatnot in them.

    .

    Something you should bear in mind.

    The idea of these forums is you ask a question ( that's one question ) in the title.

    When you ask a question, there are possible solutions suggested based on that.

    The body of your post includes explanation and code to reproduce the issue. Or similar stuff.

    Once you get an answer solves your issue you "mark" that as the answer.

    You can also upvote that or other posts. 

    And more than one post might be valid answers.

    Once you mark an answer that's the thread done.

    It has an answer and MSFT + we volunteers can focus on other threads.

    Not a big deal but please remember this in future.

    Thanks in advance.


    Hope that helps.

    Technet articles: WPF: Layout Lab; All my Technet Articles

    Friday, May 17, 2019 7:13 PM
    Moderator

  • Hi   Doug.Kennedy,

    You may refer the following toturial to create a WPF Application.

    Walkthrough: My first WPF desktop application

    I also tried on my side( Vsiaul Studio 2019, C#). When I create a new WPE Application it also create the App.xaml (c#) file. 

    >>Which is puzzling as that is what step 2 is indicating should happen.

    App.xaml is the declarative starting point of your application. Visual Studio will automatically create it for you when you start a new WPF application. This class extends the Application class, allowing us to do stuff on the application level. 

    The App.Xaml defines any application resources. You also use this file to specify the UI, in this case MainWindow.xaml, that automatically shows when the application starts.

    StartupUri="MainWindow.xaml"

    You can refer the WPF-Samples :  Which contains the samples that demonstrate the API usage patterns and popular features for the Windows Presentation Foundation in the .NET Framework for Desktop.


    Best Regards

    Yong Lu





    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Doug.Kennedy Monday, May 20, 2019 8:39 PM
    Monday, May 20, 2019 5:48 AM
    Moderator