In my Visual Studio, removing the DEBUG TOOL in runtime is at "Debugging>Hot Reload>WPF and UWP>Enable in-app toolbar". Maybe it will help someone ! By the way I can't thank you enough for you content Tim
In order to remove the WPF tools for debugging during runtime in VS 2022 we have to now go to "Tools->Options->Debugging->XAML Hot Reload " and uncheck "WPF" in the "Enable XAML Hot Reload" Section.
Also, it took me years to understand that the models are not really about the data layer, and here you sharpen this idea very clearly. Thank you again!
For those having an 'doesn't exist in the namespace' error on 12:40 (In the App.xaml file).I think I solved the problem by pressing 'build' (on top in Visual Studio). Afterwards the error dissapeared (also checked by restarting VS). Not sure if this is totally correct, but it might solve the error. Note: did not yet delete the MainWindow.xaml on 13:25 Update: after deleting MainWindow I received an build error from VS, asking me if I want to continue. Pressed no, received another error. Tried compiling again and now it worked, I now see the ShellView as in 13:43 (also after restarting VS no issues found).
I have had errors in Visual Studio resolve themselves by Hitting Clean Solution, Build Solution. Then closing and re-opening Visual Studio. It's my go-to first step if I have something weird like that come up.
I think he forgot to add (or maybe I missed it?) to remove 'StartupUri="MainWindow.xaml"' on Line 5 of App.xaml. (Below' xmlns:local="clr-namespace:RMDesktopUI"'.) That fixed it for me.
I think it is an incredible idea in teaching MVVM to say that it is a UI pattern, and it is not a way of layering the application. This was a stumbling block when I was trying to learn about MVVM, and most people who are trying to teach it seldom mention it, so thank you.
You hit my brain with the great idea again. I was confused about how to locate model classes when I redesign one of Xamarin projects, which also has MVVM pattern, to meet enterprise architecture. I (wrongly) understood I had to move model and viewmodel classes of MVVM to other layers like the business logic layer. However, that used to bring about lots of tweaks in my code. Now, you told that MVVM components should remain in (Xamarin) UI project. With that idea, everything can get clearer than before. I really appreciate it. FYI, when I saw your video of data access, you told that data model class for ORM( or OM for Dapper) is just for communication with database. It is also big help to me because I had the same confusion as the above one; a model class of MVVM should be identical to a data model class. With that understanding, I used to be afraid to define even a simple model class because there are lots of things to consider in order to associate a single class definition both to Model of MVVM and Data Model. Many thanks for your help.
Man, you are just... great. I can't even describe it. I was looking for a course like this for years. I can't wait to start making my own apps, basing on what I learn here : )
I've never done any WPF before as I've been a WinForm developer for a long time now, so all this is actually new to me. Thanks for sharing and hopefully I can keep up with this project :) Thanks Tim!
I just subscribed to Time Corey at Patreon to support your efforts. Thank you for being an amazing instructor. Even as a seasoned developer for many years, I find valuable tips and good practices in your videos.
Any chance you would consider doing a series on WPF-MVVM-XAML beginner to advanced without using plugins etc? I think it’s important to understand what these technologies do before using 3rd party add ons. Would def pay for such a course.
I have been playing around with xamarin.forms before but not wpf. And now seeing that wpf also use mvvm makes me really excited because I already have a basic idea of how it works. I really appreciate your work Tim, you inspire me to also teach others some day.
Small tip: quicker way to remove that black box from UI: on the left when you run is collapsed panel titled Live Visual Tree. Expand it and first icon from left will toggle this on your app UI.
Wow. If this is dumbing down I'd hate to see the hard version. I'm not exactly a complete beginner to .NET but I am completely lost. I hate the way Tim just throws terms at us without explaining: API, Token, Parameter, Endpoint, Swashbuckle, MVVM, Calburn micro...
Hi, why does there need to be a MergedDictionary inside the ResourceDictionary? I agree it needs to be there - I tried it without and it didn't work, but the Caliburn Micro docs don't explain why it needs to be layered like that in WPF.
I like the approach where you put your (main) view model(s) object in the app.xaml.cs - it makes it more obvious what is going on. No need for additional package.
Do you mean putting the viewmodel actually in the app.xaml.cs file or do you mean call it from there. This setup is designed to use Caliburn Micro, which does require a bit more setup in the beginning but it will make life a lot easier down the road.
It depends. If you are creating a new project or are early on in a project, probably. If you are working on an existing project, probably not. Don't forget that CM is open source. If you needed to update CM, you can do that just like you would with your own code.
It might help to watch my MVVM in WPF video ( th-cam.com/video/laPFq3Fhs8k/w-d-xo.html ) because that gives you a more in-depth introduction to the topic but basically, Caliburn Micro handles the connections based upon convention. So, it matches the View with the ViewModel of the same name (Shell, in this case so ShellView and ShellViewModel). It will do something similar when it comes to wiring up properties to textboxes, etc.
Hi Tim, thank you so much for your wonderful posting. In your other course bundle - C# app from start to finish, you have used MVC add-on replaces the Winform UI to fit the web-based application. Question please, can I follow the same way to replace WPF with MVC, even afterward Core WPF with Core MVC to fit Web App? Or do you have a plan to dev an MVC Add-on for this serial course? If it is, that's must be an excellent nows for me :) :) :)...
Really, levels of abstraction. Model supposedly should work with any UI, while it's objects are still loaded into RAM, ViewModels should be like a reflection a of an actual WPF UI, just in terms of c# classes (so, for example, you would have some enum in view model bound to some property in view through converter), this layer should also be supposedly independent of an actual UI implementation, as long as it supports proper databinding and also commands, so like, yeah. Views are the most simple layer, just xaml. This is, of course, only talking about data, with logic it gets a bit less clear. I'm, admittedly, new to MVVM myself, and can only elaborate further by saying that I have found two contradicting sources, one saying that you should put all your logic into ViewModels, while the other said that the Model should also contain some, that which is truly UI indpenedent (so, for example, the above mentioned enum would have no place in the model if, for example, it related background color to something else).
Love the videos so far! I'm using the playlist (and timestamp) to keep myself in the correct order but a suggestion for the future would be to label the videos a little easier. Maybe have them listed as "Week 1", "Week 2", etc or something that makes it easier because you go from SQL setup to WPF with MVVM Project Setup. I do understand the last video said about planning and we can't move forward with SQL tables until we know what data we'll be storing but it would be helpful for the future. Just my 2 cents but besides that, I've finally found a reason to switch from php to asp. Thank you and this will save me massive amount of time, plus learning how true tokens work is a plus. I was doing it completely different (using a guid that I create when the account was setup) and your way is more secure.
Similar, but it depends on which ASP.NET project type you are talking about. If you are talking about WebForms then the difference is that the ViewModel is loosely coupled to the View and is easily testable, unlike the code behind for WebForms. If you are talking about Blazor Server, it is extremely similar (Blazor Server basically uses MVVM).
@@IAmTimCorey Sorry, I should have been more specific. I meant ASP.NET webforms. Your explanation of MVVM is the clearest explanation that i have seen. And now knowing that the ViewModel is similar in concept to a testable code behind file for webforms makes it even clearer. Thanks
Tim, just finished this episode on MVVM. A great refresher on Caliburn Micro. I went back to your into to this course to confirm that you will also be using AutoFac along the way. My question is whether you are going to integrate AutoFac to control dependency injection for Caliburn Micro, or whether you are going to use them separately somehow. One reason I ask is that I am upgrading a project to use AutoFac,, and I may want to add a WPF UI as it gets bigger. It is now just a console application. Many thanks for these great videos. Harry Roper
I am following the series and it's saying "the type local was not found". any chance they might've changed that? if yes what is the new name? thank you in advance by the way. god really bestowed the gift of teaching on you.
@@IAmTimCorey turns out, i didn't return the ShellViewModel from the bootstrapper class. thanks for the help you are putting out to the rest of us brother. i am eagerly waiting for the next monthly access pass. is there a specific date for it?
Hi Tim You truly are a wonderful teacher, I am glad that I found your channel. Quick question, is it a good idea to have both the API and UI in the same solution or have them in different solution?
Good question. The solution does not matter in the fact that it does not provide a boundary. You can mix layers in the same solution without causing any problems. The only thing the solution does is provide us with a way to group our projects. Technically, you could have projects that had no relationship with each other in the same solution and it would not be a problem. Solutions are just a convenience. So no, it usually isn't a good idea to separate the project types out into separate solutions unless it makes it easier on your process in some way. Later in this course I will put these projects into folders to make them visually more separate. That helps too.
The bootstrapper class is what sets up the MVVM system. You need it to be the starting point so that Caliburn Micro starts and can wire up the views to the viewmodels, etc.
@@IAmTimCorey Does the CM use convention of naming for wiring? Is it dynamically adding data templates to application's resources or is it just setting data contexts? And what if we have View and ViewModels in different projects? Thank you in advance.
After I configure Bootstrapper in app.xaml. I am getting error as "Then Name "BootStrapper" does not exists in the namespace "clr-namespace:TRMDesktopUI"". "local:BootStrapper" was not found.
I solved this problem as my namespace was spelled incorrectly. But now hitting on another issue. I get this error "An exception of type 'System.NullReferenceException' occurred in Caliburn.Micro.Platform.dll but was not handled in user code Object reference not set to an instance of an object." on code line of DisplayRootViewFor();
I'm glad you figured it out. As for the next error, it sounds like you have a setup error somewhere in your configuration. You might not have set up the DI system properly (another typo?) or maybe you have a typo in the View name. Not sure.
@@IAmTimCorey Hi Tim, I enjoy your course but am getting stuck here with two errors: 1. is the same as above, Bootstrapper does not exist in the namespace "clr-namespace:TRMDesktopUI", but I do not have any typos, exactly followed your tutorial - any suggestions? 2. it tells me that on the file App.xaml row 5 a name should not start with "
OK, please don't shoot me for asking, but there was a lot of wording that I didn't fully understand in this, my question is, why create a window only to delete it later?
No one gets shot for asking questions. I'm glad you asked. I didn't create MainWindow.XAML. That window is the default window that gets created when you create a new WPF project, just like you get Form1 when you create a new WinForms project.
Not sure how to ask this in a way to get a realistic answer--but how do you open a new window in MVVM with Caliburn Micro? Will this be something you show how to do in the TimCo Retail Manager Video Series?
I tried this and it work, but my question is, how did the ShellViewModel able to know which UI to display? I usually add the vm in my view.xaml to know which is which.
nvm, got the answer from the comments.... here is the explanation... Caliburn Micro handles the connections based upon convention. So, it matches the View with the ViewModel of the same name (Shell, in this case so ShellView and ShellViewModel). It will do something similar when it comes to wiring up properties to textboxes, etc.
I would recommend against it for a couple of reasons. First, WebForms are deprecated. They are no longer being developed by Microsoft and are not in .NET Core. That's important. You should avoid creating new WebForm projects. Maintaining existing WebForm projects is a different story. Second, this is a desktop application. Trying to follow along on the web will be frustrating and difficult. Later on in the series, we will add a web front-end.
I have limited experience with Prism. Basically, I did an initial compare and found that Prism seemed more complicated and confusing (to me). I found Caliburn Micro the easiest, simplest, and least confusing of all of the MVVM frameworks I tried. That goes a long way for me.
Hello Tim, I am trying to add a API layer to a .NET8 project. I have the database and the login forms built but no API layer. Currently the forms interact directly with the database. Should I create something like the bootstrapped.cs and API helpers to create a API between the forms and the database?
I would create a separate API project rather than trying to connect it to your current project. That way you can scale it separately and it can be deployed independently.
@@IAmTimCorey guess I’m not sure what’s more secure in a project, MVC controller to the Db or WebAPI to the Db. This project appears to contain both, im a little confused.
Hi Tim: When I create the Bootstrapper class and that add the implements "BootstrapperBase" to this class, I get my red squiggly as expected. However, when I press [control-dot] I get a "Show Suggestions" dialogue box that appears to hang. It says that it is "gathering suggestions..." I normally don't get this hang when I use [control-dot] for "using" suggestions. I'm assuming it may be due to the Caliburn.Micro package I installed? Any suggestions? I just hit cancel, but now I have to manually enter the using statement.
Hello, I'm following the course from the beginning. Thank you, it's awesome. I have quite zero knowledge of WPF. Am I missing important notions starting learning to it using Caliburn micro?
Hi Tim. I love your new course. In the meanwhile, I'm implementing your older courses into WPF MVVM using caliburn.micro. I'm wondering if there an easy way to show a message box to the user from the ViewModel by the MVVM way? So far it seems I need to create a model, a ViewModel and a view but maybe there's an easier way doing this but I can't find anything in 'CaliburnMicro' documentation. I couldn't find any useful information at all not just about this topic maybe it's because of my poor English but it would be great if you could give me some advice about where to search for more advanced customization options. Thanks, and Keep up the good work. Cheers Alex.
Typically, we end up creating a View/ViewModel to represent a message box. Here is the documentation on CM for more in-depth explanations of the various parts of CM: caliburnmicro.com/documentation/
Where do you go to learn about Caliburn Micro? I've looked at their documentation and It's very daunting and confusing. I'm certain I'm not using it the way it was intended to be used.
Hi Tim While I add MVVM on WPF project after I run it say "Cannot find view ViewModel" can you suggest me please !!!!!!! I found solution but its not working. Please suggest me on that part.
It sounds like you have a spelling issue (or casing issue). Check to be sure your bootstrapper is calling the correct ViewModel (ShellViewModel) and that it is spelled correctly and the casing is correct (uppercase, lowercase letters). Also, make sure that ShellViewModel is a Caliburn Micro class (inherits from Conductor). Next, make sure that the ShellViewModel is in the ViewModels (plural) folder. Finally, make sure the ShellView is in the Views (plural) folder and is a Window object.
for my issue it was that I was missing the "s" off of ViewModels folder... once I changed that I had to go through the solution and change the namespace references... hope this helps.
No, it isn't. MVVM is a UI framework. That means that all parts of it (Models, Views, and ViewModels) are part of the UI. The confusion is typically that these three items represent the three major layers (data access, UI, and business logic respectively) but that is incorrect. The model holds the data for the UI to display. That model can be decorated for the UI (validation messaging, restrictions, etc.) in a way that a data access model normally is not.
Tim since you respond i would like if you can help me with this also you said that if want to learn more i have to pay $5.00 a month, will be find with me.
I don't say you need to pay $5/month to learn more, just to get the source code. If you follow along with me, you don't need to get the source code from me.
Caliburn Micro is a library, just like Newtonsoft or Dapper. It is open source and has a long-term record of support and improvements. I prefer to use it for MVVM rather than reinventing the wheel each time I build a WPF application.
@@IAmTimCorey That makes sense! I would say, however, that it can make it tough for anyone who gets a job and begins work on a project/application and NEEDS to understand legacy systems (apps) that did NOT use these 3rd party solutions. BUT , I do realize as I write this that a good software engineer/developer is going to use multiple sources to understand anything that may or may not have been covered. ;-)
It's just sad that Microsoft is doing great and gives the energy to the WPF again, yet the Caliburn Micro framework seems like it isn't being updated anymore.
Caliburn Micro is definitely still being updated. The last commit to the project was three days ago. They just take their time making new releases, which I am fine with. They try to be cautious about how they release new versions so they don't break things. Also, it works great as it is so why do we need a new version? It is always nice to get new things but I'm happy knowing how to use something for more than a week before it changes.
Okay, right off the bat you say you're a fan of MVVM but you don't explain what that is. What is XAML? What is Caliburn Micro? I'd appreciate it if you *PLEASE STOP throwing all these fancy terms at us without explaining what you're talking about* :( And does this MVVM thingie mean we're not going to use MVC? I'm also curious, why WPF and not WinForms? Oh and to add insult to injury at the very end I get an error: System.IO.IOException: Cannot locate resource mainwindow.xaml. Why did we delete this?
The TimCo series assumes you have a pretty solid background of C# and its ecosystem. This video ( th-cam.com/video/LUv20QxXjfw/w-d-xo.html ) is intended to help you assess where you are and the topics you need to add to your base skills. I hope it will help you fill in any gaps. My goal is to make becoming a developer easier, so I have videos to help you build your tool set. TimCo is building the entire house AFTER you have gathered the tools and learned to use them.
@@IAmTimCorey Okay I am a semi-beginner to C# but hardly new. I don't know what you mean by ecosystem, but the issues I have are not with the C# language, syntax, MVC, classes, or related stuff. I've already gone through your beginner courses, your OO courses, and completed the "Full C# application" with the Tournament Tracker. I've done all that already, and I don't recall any reference to APIs or Caliburn Micro. I admit I did skip the WPF part of the series because we don't build desktop apps at my company (we're a MS Access shop for desktop apps), but that's not my biggest issue.
There is a LOT to learn in C#. Learning basic C# syntax and OOP is a good start, but there is still a lot more to cover. In the Foundation in C# course series, there are 10 courses. Each of those builds on the next. For instance, I believe you are saying that you did the two courses on OOP. That is course #4 and #6 (#5 was practicing what you had learned so far). If you continue in the series, #7 is on common project types, including WPF and API. #8 will cover data access techniques (quite a few of them). And #9 will practice what you learned so far in the series, including creating both a WPF and ASP.NET Core Razor Pages app. Once you get through all ten courses in the series, you have the knowledge of a junior developer. You still have a lot to add. That's why it is called the Foundation series. It sets a good foundation for you to build upon. Next, you need to pick your area you want to spend more time in and specialize in going into more depth in that area. That's why I am adding in depth courses. For instance, my latest in depth course is .NET Core AppSettings In Depth. It is a four hour course just on learning how to use appsettings in .NET Core projects. Even if you were to take every course I offer, you will still have a lot to learn. New things are coming out every day. That's why I created the Exploring C#: Blazor WebAssembly course. Not only does it teach you five cool things to do in Blazor WebAssembly, it also teaches you how to learn new things on your own.
@@IAmTimCorey Well, I am certainly humbled :). I'm kind of caught between a rock and a hard place. I don't consider myself, nor do I have a desire to be a "software engineer." I even despise the term "coder." I'm a database administrator and developer by trade. My very specific goal (at least in short term) is to be able to help my other developers at my company with their .NET Entity Framework projects. We don't use WPF or any of those things, so I want to build the foundation but I need to be laser-focused on .NET MVC with going down as few rabbit holes as possible. I've mostly stayed away from your courses so far because you don't have anything on EF, which is unfortunate because there is NOTHING good out there at any level. I've worked on professional MVC projects before and sense I'm pretty close to at least my short term goals. I mean I've been on a few professional projects and have never seen any of this stuff, I've never had to program an API, make a WPF program nor have I run into any abstract classes. So I can't go down all sorts of rabbit holes learning this technology and that and not chase every shiny object that comes out. I tried it with .NET Core and it only confused me further so I abandoned it. I would rather learn what I need to learn to help with our MVC .NET projects and worry about the other stuff later.
@@tomservo75 I recently went through Tim's C# Foundations course, and highly recommend it if you haven't already started on it. It will fill those specific gaps you're talking about in a concise, condensed learning path. I prefer it over Pluralsight's offerings because Pluralsight's C# learning path for similar topics are covered in an order that isn't really conducive to fully understanding and learning the topic(s) if the person watching is not at least slightly familiar with them. Tim's C# course structure is laser focused on teaching you what you will need to know, and in an order that makes sense on when to learn it. Then after going through that course, come back to this one to learn how to implement and combine the project overviews from the C# course into a production ready state.
In my Visual Studio, removing the DEBUG TOOL in runtime is at "Debugging>Hot Reload>WPF and UWP>Enable in-app toolbar".
Maybe it will help someone !
By the way I can't thank you enough for you content Tim
Thanks for sharing.
Just came to comments section to write it. Thanks, anyway.
In order to remove the WPF tools for debugging during runtime in VS 2022 we have to now go to "Tools->Options->Debugging->XAML Hot Reload " and uncheck "WPF" in the "Enable XAML Hot Reload" Section.
Thanks for sharing.
The same thing can be achieved by unchecking the "Enable in-app toolbar" in the same setup page
Also, it took me years to understand that the models are not really about the data layer, and here you sharpen this idea very clearly. Thank you again!
Mosh Hamedani and Tim Corey are the best
I am glad you were able to expand your view.
For those having an 'doesn't exist in the namespace' error on 12:40 (In the App.xaml file).I think I solved the problem by pressing 'build' (on top in Visual Studio). Afterwards the error dissapeared (also checked by restarting VS). Not sure if this is totally correct, but it might solve the error.
Note: did not yet delete the MainWindow.xaml on 13:25
Update: after deleting MainWindow I received an build error from VS, asking me if I want to continue. Pressed no, received another error. Tried compiling again and now it worked, I now see the ShellView as in 13:43 (also after restarting VS no issues found).
Thanks for sharing
I have had errors in Visual Studio resolve themselves by Hitting Clean Solution, Build Solution.
Then closing and re-opening Visual Studio.
It's my go-to first step if I have something weird like that come up.
I think he forgot to add (or maybe I missed it?) to remove 'StartupUri="MainWindow.xaml"' on Line 5 of App.xaml. (Below' xmlns:local="clr-namespace:RMDesktopUI"'.) That fixed it for me.
I was getting frustrated that I couldn't figure out this error. Thank you for sharing the solution.
I think it is an incredible idea in teaching MVVM to say that it is a UI pattern, and it is not a way of layering the application. This was a stumbling block when I was trying to learn about MVVM, and most people who are trying to teach it seldom mention it, so thank you.
You are welcome. I am glad you found it valuable.
You hit my brain with the great idea again. I was confused about how to locate model classes when I redesign one of Xamarin projects, which also has MVVM pattern, to meet enterprise architecture. I (wrongly) understood I had to move model and viewmodel classes of MVVM to other layers like the business logic layer. However, that used to bring about lots of tweaks in my code. Now, you told that MVVM components should remain in (Xamarin) UI project. With that idea, everything can get clearer than before. I really appreciate it.
FYI, when I saw your video of data access, you told that data model class for ORM( or OM for Dapper) is just for communication with database. It is also big help to me because I had the same confusion as the above one; a model class of MVVM should be identical to a data model class. With that understanding, I used to be afraid to define even a simple model class because there are lots of things to consider in order to associate a single class definition both to Model of MVVM and Data Model.
Many thanks for your help.
Glad it helped!
Hi Tim, I am asking to myself "Why are not there an AdSense in this awesome Video???"
You are kind person Tim. Thank You...
Hope God give you more.
Glad it was helpful!
At 05:19, that option (in the german version of the Visual Studio) is Extras -> Optionen -> Debugging - > Hot Reload -> In-App-Symbolleiste aktivieren
Thanks for sharing!
On 11:00 Tim makes reference to the DisplayRootViewFor method but it doesn't exist, they changed it to DisplayRootViewForAsync in version 4.0.
Yep, the changed a lot of things to async versions in the 4.x version.
Does the Async require a "Await" statement?
Thank you!
Man, you are just... great. I can't even describe it. I was looking for a course like this for years. I can't wait to start making my own apps, basing on what I learn here : )
You can do it!
I've never done any WPF before as I've been a WinForm developer for a long time now, so all this is actually new to me. Thanks for sharing and hopefully I can keep up with this project :) Thanks Tim!
I think you will be fine. It will be an adventure. :-)
@@IAmTimCorey It sure will! Even through I might never use WPF going forward, it's always good to have some knowledge about it.
I just subscribed to Time Corey at Patreon to support your efforts. Thank you for being an amazing instructor. Even as a seasoned developer for many years, I find valuable tips and good practices in your videos.
Excellent! Thank you.
Any chance you would consider doing a series on WPF-MVVM-XAML beginner to advanced without using plugins etc? I think it’s important to understand what these technologies do before using 3rd party add ons. Would def pay for such a course.
I noted your recommendation by adding it to Tim's list of possible future topics, thanks.
@@tomthelestaff-iamtimcorey7597 Thank you
You're changing lives man
Thank you!
I have been playing around with xamarin.forms before but not wpf. And now seeing that wpf also use mvvm makes me really excited because I already have a basic idea of how it works. I really appreciate your work Tim, you inspire me to also teach others some day.
Awesome!
amazing series...I wish it was daily :D
Thank you! I wish I had the time to do it daily.
I agree to it too. As always, amazing content. Wish it can be more frequent
Worked with WPF for the last 5 years and I cannot imagine making applications in any other way.
It is nice, although it takes a bit of extra work to configure.
I could say the same thing, but for WinForms. WPF is just strange to me at the moment. :)
Small tip: quicker way to remove that black box from UI: on the left when you run is collapsed panel titled Live Visual Tree. Expand it and first icon from left will toggle this on your app UI.
Sweet! Thanks for sharing.
Thanks for dumbing it down. I might actually be able to complete this project
Glad you are following along.
Wow. If this is dumbing down I'd hate to see the hard version. I'm not exactly a complete beginner to .NET but I am completely lost. I hate the way Tim just throws terms at us without explaining: API, Token, Parameter, Endpoint, Swashbuckle, MVVM, Calburn micro...
@@tomservo75 I can totally recommend starting with something easier like JavaScript, to learn those terms in practice
Hi, why does there need to be a MergedDictionary inside the ResourceDictionary? I agree it needs to be there - I tried it without and it didn't work, but the Caliburn Micro docs don't explain why it needs to be layered like that in WPF.
I like the approach where you put your (main) view model(s) object in the app.xaml.cs - it makes it more obvious what is going on. No need for additional package.
Do you mean putting the viewmodel actually in the app.xaml.cs file or do you mean call it from there. This setup is designed to use Caliburn Micro, which does require a bit more setup in the beginning but it will make life a lot easier down the road.
@@IAmTimCorey Calling it from there. If there will be another video with caliburn and what it does I'll watch and judge what's best :)
Hi, Tim, thanks for the greate tutorial. Caliburn.micro would not be actively maintained, should we change to other framework?
It depends. If you are creating a new project or are early on in a project, probably. If you are working on an existing project, probably not. Don't forget that CM is open source. If you needed to update CM, you can do that just like you would with your own code.
I've been waiting for this! Thanks a lot!
You are welcome. Stay tuned - you might get even more soon.
I dont know anything about WPF, but where in the ShellViewModel was Shellview linked?? on start, the shellview was lunched, like how ??
It might help to watch my MVVM in WPF video ( th-cam.com/video/laPFq3Fhs8k/w-d-xo.html ) because that gives you a more in-depth introduction to the topic but basically, Caliburn Micro handles the connections based upon convention. So, it matches the View with the ViewModel of the same name (Shell, in this case so ShellView and ShellViewModel). It will do something similar when it comes to wiring up properties to textboxes, etc.
very clear and Precise.Thanks Tim.
You are welcome.
Could you please make a video tutorial on handling mouse events through commands in wpf following mvvm design pattern?
I will add it to the list. Thanks for the suggestion.
Tim as always verry clear and great video. Thx
Thank you!
i get error "cannot find view for TRMDesktopUI.ViewModel.ShellViewModel"
The folder name should be ViewModels (plural). I'm guessing that is your issue. You will need to change the namespace as well.
Hi Tim, thank you so much for your wonderful posting. In your other course bundle - C# app from start to finish, you have used MVC add-on replaces the Winform UI to fit the web-based application. Question please, can I follow the same way to replace WPF with MVC, even afterward Core WPF with Core MVC to fit Web App? Or do you have a plan to dev an MVC Add-on for this serial course? If it is, that's must be an excellent nows for me :) :) :)...
You definitely could do that. I am considering adding a web project to the system. We will see.
@@IAmTimCorey Greate, can't wait for it. Thanks, Tim.
8:20 So it's like m to n relations in db?
Models -< ViewModels >- View ?
Really, levels of abstraction. Model supposedly should work with any UI, while it's objects are still loaded into RAM, ViewModels should be like a reflection a of an actual WPF UI, just in terms of c# classes (so, for example, you would have some enum in view model bound to some property in view through converter), this layer should also be supposedly independent of an actual UI implementation, as long as it supports proper databinding and also commands, so like, yeah. Views are the most simple layer, just xaml. This is, of course, only talking about data, with logic it gets a bit less clear. I'm, admittedly, new to MVVM myself, and can only elaborate further by saying that I have found two contradicting sources, one saying that you should put all your logic into ViewModels, while the other said that the Model should also contain some, that which is truly UI indpenedent (so, for example, the above mentioned enum would have no place in the model if, for example, it related background color to something else).
Love the videos so far! I'm using the playlist (and timestamp) to keep myself in the correct order but a suggestion for the future would be to label the videos a little easier. Maybe have them listed as "Week 1", "Week 2", etc or something that makes it easier because you go from SQL setup to WPF with MVVM Project Setup. I do understand the last video said about planning and we can't move forward with SQL tables until we know what data we'll be storing but it would be helpful for the future. Just my 2 cents but besides that, I've finally found a reason to switch from php to asp. Thank you and this will save me massive amount of time, plus learning how true tokens work is a plus. I was doing it completely different (using a guid that I create when the account was setup) and your way is more secure.
Thanks for sharing. Playlists are designed to address the flow, but I see your point.
Tim would you say that in concept the ViewModel classes are akin to the code behind files in ASP.NET?
Thanks
Similar, but it depends on which ASP.NET project type you are talking about. If you are talking about WebForms then the difference is that the ViewModel is loosely coupled to the View and is easily testable, unlike the code behind for WebForms. If you are talking about Blazor Server, it is extremely similar (Blazor Server basically uses MVVM).
@@IAmTimCorey Sorry, I should have been more specific. I meant ASP.NET webforms.
Your explanation of MVVM is the clearest explanation that i have seen. And now knowing that the ViewModel is similar in concept to a testable code behind file for webforms makes it even clearer.
Thanks
Hello Tim, what is the advantage of using MVVM over MVC in this project?
WPF is better structured for MVVM.
Tim, just finished this episode on MVVM. A great refresher on Caliburn Micro. I went back to your into to this course to confirm that you will also be using AutoFac along the way. My question is whether you are going to integrate AutoFac to control dependency injection for Caliburn Micro, or whether you are going to use them separately somehow. One reason I ask is that I am upgrading a project to use AutoFac,, and I may want to add a WPF UI as it gets bigger. It is now just a console application. Many thanks for these great videos.
Harry Roper
I'll be using AutoFac in this solution and DI in the WPF project. You will find out more details soon.
@@IAmTimCorey Thanks Tim. I am looking forward to it.
@@IAmTimCorey When will you upload the next video? ^_^
I am following the series and it's saying "the type local was not found". any chance they might've changed that? if yes what is the new name?
thank you in advance by the way. god really bestowed the gift of teaching on you.
I think you missed an entry at the top of the XAML file where we define local (line 6 at 3:41 will show you that entry).
@@IAmTimCorey turns out, i didn't return the ShellViewModel from the bootstrapper class. thanks for the help you are putting out to the rest of us brother. i am eagerly waiting for the next monthly access pass. is there a specific date for it?
Hi Tim
You truly are a wonderful teacher, I am glad that I found your channel.
Quick question, is it a good idea to have both the API and UI in the same solution or have them in different solution?
Good question. The solution does not matter in the fact that it does not provide a boundary. You can mix layers in the same solution without causing any problems. The only thing the solution does is provide us with a way to group our projects. Technically, you could have projects that had no relationship with each other in the same solution and it would not be a problem. Solutions are just a convenience. So no, it usually isn't a good idea to separate the project types out into separate solutions unless it makes it easier on your process in some way. Later in this course I will put these projects into folders to make them visually more separate. That helps too.
What is the advantage of using a bootstrapper rather than just changing the name of the startup app in xaml from mainwindow to shellview?
The bootstrapper class is what sets up the MVVM system. You need it to be the starting point so that Caliburn Micro starts and can wire up the views to the viewmodels, etc.
@@IAmTimCorey Does the CM use convention of naming for wiring? Is it dynamically adding data templates to application's resources or is it just setting data contexts? And what if we have View and ViewModels in different projects? Thank you in advance.
After I configure Bootstrapper in app.xaml. I am getting error as "Then Name "BootStrapper" does not exists in the namespace "clr-namespace:TRMDesktopUI"". "local:BootStrapper" was not found.
I solved this problem as my namespace was spelled incorrectly. But now hitting on another issue. I get this error "An exception of type 'System.NullReferenceException' occurred in Caliburn.Micro.Platform.dll but was not handled in user code
Object reference not set to an instance of an object." on code line of DisplayRootViewFor();
I'm glad you figured it out. As for the next error, it sounds like you have a setup error somewhere in your configuration. You might not have set up the DI system properly (another typo?) or maybe you have a typo in the View name. Not sure.
@@IAmTimCorey Hi Tim, I enjoy your course but am getting stuck here with two errors: 1. is the same as above, Bootstrapper does not exist in the namespace "clr-namespace:TRMDesktopUI", but I do not have any typos, exactly followed your tutorial - any suggestions? 2. it tells me that on the file App.xaml row 5 a name should not start with "
@IAmTimCorey I hit the start button and it started the application even though it indicated these errors. So everything all right!
@@stefangulas I had the same thing and the error went away after I ran it.
OK, please don't shoot me for asking, but there was a lot of wording that I didn't fully understand in this, my question is, why create a window only to delete it later?
No one gets shot for asking questions. I'm glad you asked. I didn't create MainWindow.XAML. That window is the default window that gets created when you create a new WPF project, just like you get Form1 when you create a new WinForms project.
@@IAmTimCorey Aaaah I understand. Clearing off a default file....
Not sure how to ask this in a way to get a realistic answer--but how do you open a new window in MVVM with Caliburn Micro? Will this be something you show how to do in the TimCo Retail Manager Video Series?
Yep, we will be doing multiple windows. I'll show you the ropes.
Hi Tim,
is there a CM Templatepackage like it is for Prism that e.g. adds views and viewmodels at the same time.
Not that I know of. Sounds like a cool little plug-in you could write for Visual Studio.
I tried this and it work, but my question is, how did the ShellViewModel able to know which UI to display? I usually add the vm in my view.xaml to know which is which.
nvm, got the answer from the comments.... here is the explanation... Caliburn Micro handles the connections based upon convention. So, it matches the View with the ViewModel of the same name (Shell, in this case so ShellView and ShellViewModel). It will do something similar when it comes to wiring up properties to textboxes, etc.
Yep.
Thank you for such a good tutorial.
You are welcome.
I love this series so much. But I want to know that is this possible to use webform as we use WPF.??
Help me
I would recommend against it for a couple of reasons. First, WebForms are deprecated. They are no longer being developed by Microsoft and are not in .NET Core. That's important. You should avoid creating new WebForm projects. Maintaining existing WebForm projects is a different story. Second, this is a desktop application. Trying to follow along on the web will be frustrating and difficult. Later on in the series, we will add a web front-end.
Hello, Tim
I'm having an issue when i run the project its says Cannot find view for ViewModels.ShellViewModel.
Please help me. Thanks.
It sounds like you have a naming issue. Like your ShellView isn't named quite right or isn't in the Views folder.
Yeah me too.
Do you know how Caliburn Micro compares to Prism? If so are they about equal in terms of use or is there features that make Caliburn Micro better?
I have limited experience with Prism. Basically, I did an initial compare and found that Prism seemed more complicated and confusing (to me). I found Caliburn Micro the easiest, simplest, and least confusing of all of the MVVM frameworks I tried. That goes a long way for me.
Hello Tim, I am trying to add a API layer to a .NET8 project. I have the database and the login forms built but no API layer. Currently the forms interact directly with the database. Should I create something like the bootstrapped.cs and API helpers to create a API between the forms and the database?
I would create a separate API project rather than trying to connect it to your current project. That way you can scale it separately and it can be deployed independently.
@@IAmTimCorey guess I’m not sure what’s more secure in a project, MVC controller to the Db or WebAPI to the Db. This project appears to contain both, im a little confused.
Love all ur Tutes Tim!
I am glad.
@@IAmTimCorey Do you happen to have a discord Server? would love to be in it if you do. Because i have so many things to learn ^_^
I don't at this point. I am looking into it as an option.
thanks for this video, i am new to this wpf. thank a lot.
You are welcome.
Hi Tim: When I create the Bootstrapper class and that add the implements "BootstrapperBase" to this class, I get my red squiggly as expected. However, when I press [control-dot] I get a "Show Suggestions" dialogue box that appears to hang. It says that it is "gathering suggestions..." I normally don't get this hang when I use [control-dot] for "using" suggestions. I'm assuming it may be due to the Caliburn.Micro package I installed? Any suggestions? I just hit cancel, but now I have to manually enter the using statement.
It sounds like Visual Studio is having issues. A restart might help.
Hello, I'm following the course from the beginning. Thank you, it's awesome.
I have quite zero knowledge of WPF. Am I missing important notions starting learning to it using Caliburn micro?
There is a WPF playlist on this channel that might help. It introduces Caliburn Micro and walks you through how to use it (video #2 and beyond).
@@MatazaNz thank you for your reply, very interesting
Hi Tim. I love your new course. In the meanwhile, I'm implementing your older courses into WPF MVVM using caliburn.micro. I'm wondering if there an easy way to show a message box to the user from the ViewModel by the MVVM way? So far it seems I need to create a model, a ViewModel and a view but maybe there's an easier way doing this but I can't find anything in 'CaliburnMicro' documentation. I couldn't find any useful information at all not just about this topic maybe it's because of my poor English but it would be great if you could give me some advice about where to search for more advanced customization options. Thanks, and Keep up the good work. Cheers Alex.
Typically, we end up creating a View/ViewModel to represent a message box. Here is the documentation on CM for more in-depth explanations of the various parts of CM: caliburnmicro.com/documentation/
Where do you go to learn about Caliburn Micro? I've looked at their documentation and It's very daunting and confusing. I'm certain I'm not using it the way it was intended to be used.
I have documented Caliburn Micro in these videos: th-cam.com/play/PLLWMQd6PeGY3QEHCmCWaUKNhmFFdIDxE8.html
Pity caliburn.micro is no longer being maintained. Any suggestions of alternatives? DevExpress maybe ?
I discuss that in this video - th-cam.com/video/8E000zu8UhQ/w-d-xo.html - Picking a New MVVM Framework - Moving from Caliburn Micro
Question With the release of DonetCore 3.0 can we select that framework and use Caliburn.Micro.
We are moving to .NET Core this week and moving Caliburn Micro to .NET Core 3.0 is part of the work we will do Friday. It is possible but just barely.
Thanks for the information.
Hi Tim please cover avalonia..it really can run in windows, linux..and dont know on mac...its an awesome framework. thanks.
It is high on my priority list. Thanks for the suggestion.
Hi Tim. I have a problem to start the window, the error message: Cannot find view for TRMDesktopUI.ShellViewModel.ShellViewModel... Please Help...!
[SOLVED]. I figured it out! The error was in the names for the Views, ViewModels and Models folders...!
I am glad you figured it out.
@@christiancamilogutierrezmo3329 I got the same problem, how you solved it?
oh sorry I solved, thank you guys
Hi Tim
While I add MVVM on WPF project after I run it say "Cannot find view ViewModel" can you suggest me please !!!!!!!
I found solution but its not working. Please suggest me on that part.
It sounds like you have a spelling issue (or casing issue). Check to be sure your bootstrapper is calling the correct ViewModel (ShellViewModel) and that it is spelled correctly and the casing is correct (uppercase, lowercase letters). Also, make sure that ShellViewModel is a Caliburn Micro class (inherits from Conductor). Next, make sure that the ShellViewModel is in the ViewModels (plural) folder. Finally, make sure the ShellView is in the Views (plural) folder and is a Window object.
for my issue it was that I was missing the "s" off of ViewModels folder... once I changed that I had to go through the solution and change the namespace references... hope this helps.
Moises Duarte yeah naming conventions should be properly.
Great! Thanks Tim!
My pleasure!
8:07 clear as mud, is this akin to a factory that's meant to abstract away the details?
No, it isn't. MVVM is a UI framework. That means that all parts of it (Models, Views, and ViewModels) are part of the UI. The confusion is typically that these three items represent the three major layers (data access, UI, and business logic respectively) but that is incorrect. The model holds the data for the UI to display. That model can be decorated for the UI (validation messaging, restrictions, etc.) in a way that a data access model normally is not.
good job!
Thanks!
Tim since you respond i would like if you can help me with this also you said that if want to learn more i have to pay $5.00 a month, will be find with me.
I don't say you need to pay $5/month to learn more, just to get the source code. If you follow along with me, you don't need to get the source code from me.
removing that irritating black box is just godsend !!
It is nice.
I was really interested in this. I wish you didn't use third party tools like Caliburn micro. Just teach the basics. Otherwise, thank you
Caliburn Micro is a library, just like Newtonsoft or Dapper. It is open source and has a long-term record of support and improvements. I prefer to use it for MVVM rather than reinventing the wheel each time I build a WPF application.
@@IAmTimCorey That makes sense! I would say, however, that it can make it tough for anyone who gets a job and begins work on a project/application and NEEDS to understand legacy systems (apps) that did NOT use these 3rd party solutions. BUT , I do realize as I write this that a good software engineer/developer is going to use multiple sources to understand anything that may or may not have been covered. ;-)
brackey or blackthorn
end music
Not sure.
It's just sad that Microsoft is doing great and gives the energy to the WPF again, yet the Caliburn Micro framework seems like it isn't being updated anymore.
Caliburn Micro is definitely still being updated. The last commit to the project was three days ago. They just take their time making new releases, which I am fine with. They try to be cautious about how they release new versions so they don't break things. Also, it works great as it is so why do we need a new version? It is always nice to get new things but I'm happy knowing how to use something for more than a week before it changes.
Okay, right off the bat you say you're a fan of MVVM but you don't explain what that is.
What is XAML? What is Caliburn Micro? I'd appreciate it if you *PLEASE STOP throwing all these fancy terms at us without explaining what you're talking about* :( And does this MVVM thingie mean we're not going to use MVC? I'm also curious, why WPF and not WinForms?
Oh and to add insult to injury at the very end I get an error: System.IO.IOException: Cannot locate resource mainwindow.xaml. Why did we delete this?
The TimCo series assumes you have a pretty solid background of C# and its ecosystem. This video ( th-cam.com/video/LUv20QxXjfw/w-d-xo.html ) is intended to help you assess where you are and the topics you need to add to your base skills. I hope it will help you fill in any gaps. My goal is to make becoming a developer easier, so I have videos to help you build your tool set. TimCo is building the entire house AFTER you have gathered the tools and learned to use them.
@@IAmTimCorey Okay I am a semi-beginner to C# but hardly new. I don't know what you mean by ecosystem, but the issues I have are not with the C# language, syntax, MVC, classes, or related stuff.
I've already gone through your beginner courses, your OO courses, and completed the "Full C# application" with the Tournament Tracker. I've done all that already, and I don't recall any reference to APIs or Caliburn Micro. I admit I did skip the WPF part of the series because we don't build desktop apps at my company (we're a MS Access shop for desktop apps), but that's not my biggest issue.
There is a LOT to learn in C#. Learning basic C# syntax and OOP is a good start, but there is still a lot more to cover. In the Foundation in C# course series, there are 10 courses. Each of those builds on the next. For instance, I believe you are saying that you did the two courses on OOP. That is course #4 and #6 (#5 was practicing what you had learned so far). If you continue in the series, #7 is on common project types, including WPF and API. #8 will cover data access techniques (quite a few of them). And #9 will practice what you learned so far in the series, including creating both a WPF and ASP.NET Core Razor Pages app. Once you get through all ten courses in the series, you have the knowledge of a junior developer. You still have a lot to add. That's why it is called the Foundation series. It sets a good foundation for you to build upon. Next, you need to pick your area you want to spend more time in and specialize in going into more depth in that area. That's why I am adding in depth courses. For instance, my latest in depth course is .NET Core AppSettings In Depth. It is a four hour course just on learning how to use appsettings in .NET Core projects. Even if you were to take every course I offer, you will still have a lot to learn. New things are coming out every day. That's why I created the Exploring C#: Blazor WebAssembly course. Not only does it teach you five cool things to do in Blazor WebAssembly, it also teaches you how to learn new things on your own.
@@IAmTimCorey Well, I am certainly humbled :). I'm kind of caught between a rock and a hard place. I don't consider myself, nor do I have a desire to be a "software engineer." I even despise the term "coder." I'm a database administrator and developer by trade. My very specific goal (at least in short term) is to be able to help my other developers at my company with their .NET Entity Framework projects. We don't use WPF or any of those things, so I want to build the foundation but I need to be laser-focused on .NET MVC with going down as few rabbit holes as possible. I've mostly stayed away from your courses so far because you don't have anything on EF, which is unfortunate because there is NOTHING good out there at any level. I've worked on professional MVC projects before and sense I'm pretty close to at least my short term goals. I mean I've been on a few professional projects and have never seen any of this stuff, I've never had to program an API, make a WPF program nor have I run into any abstract classes. So I can't go down all sorts of rabbit holes learning this technology and that and not chase every shiny object that comes out. I tried it with .NET Core and it only confused me further so I abandoned it. I would rather learn what I need to learn to help with our MVC .NET projects and worry about the other stuff later.
@@tomservo75 I recently went through Tim's C# Foundations course, and highly recommend it if you haven't already started on it. It will fill those specific gaps you're talking about in a concise, condensed learning path. I prefer it over Pluralsight's offerings because Pluralsight's C# learning path for similar topics are covered in an order that isn't really conducive to fully understanding and learning the topic(s) if the person watching is not at least slightly familiar with them. Tim's C# course structure is laser focused on teaching you what you will need to know, and in an order that makes sense on when to learn it. Then after going through that course, come back to this one to learn how to implement and combine the project overviews from the C# course into a production ready state.