Get up to 80 % extra points for free! More info:

Discussion – Lesson 8 - Birthday reminder in C# .NET WPF - Wiring layers

Back

 

Comments
Avatar
Lennart Völler:12/22/2017 5:58

I like these WPF tutorials a lot. Let's face it. Coding for the console is nice and makes us feel all super geeky and hacker-like but apart from us coders there is nobody who want's to use that. So one has to learn to use Forms!

I have a question regarding Visual Studio and Forms. I found my Solution manager quiet messy and decided to put the forms into a folder. Interestingly this breaks the application completely. VS is not even able the debugger anymore, the app crashed before reaching the Main()-Method.

How can I fix this? There surely has to be a way to move and reorganize your application files after you created them!

 
Reply
12/22/2017 5:58
Avatar
Replies to Lennart Völler
David Capka Hartinger:12/22/2017 12:57

Hello Lennart,
generally it's not a good idea to move autogenerated content, I'd create a new one. The best way to divide your WPF app into folders is to create the folders and create new Windows in them (right click on the folder and choose "Add -> Window..."). Once you've your Windows in the folders ready, modify the App.xaml file to set the default Window in the StartupUri attribute:

<Application x:Class="WpfApp1.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:WpfApp1"
             StartupUri="YourFolder/Window1.xaml">
    <Application.Resources>

    </Application.Resources>
</Application>

Feel free to remove the original MainWindow.xaml file later.

Reply
12/22/2017 12:57
You can walk through a storm and feel the wind but you know you are not the wind.
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

2 messages from 2 displayed.