Wow, so far I am about a year behind on these video - but jeez the learning curve on them....I think it is really special to actually watch a professional developer - develop an app at a professional level. Not some knocked together 2 minute youtube video but a complete work through of an actual app - including problem solving in this episode. You sir are an extremely generous person and thank you for that.....on to the next one!
@IAmTimCorey3 жыл бұрын
I am glad they are pushing you to learn as we go. Way to stick with it.
@anwarsadatayub47404 жыл бұрын
Really appreciate the way you stuck with your code and took your time to debug. Others would have paused and corrected it without or with little reference. Big ups man!
@IAmTimCorey4 жыл бұрын
Thank you!
@williambell45914 жыл бұрын
Agreed, but I have to say I was surprised Tim even had to deal with Caliburn not firing the updates as expected??! I come from DevExpress MVVM & WPF controls and have recently switched to Stylet MVVM which for me, is way simpler to understand and use compared to DevEx MVVM. I considered Caliburn, but it looked just as "complicated" as DevEx MVVM, if not more so LOL...
@23myiah5 жыл бұрын
Thanks Tim, great video. I learned a lot about debugging which is a topic I do struggle with at times. For anyone who needs it here is the link to the stack overflow page stackoverflow.com/questions/30631522/caliburn-micro-support-for-passwordbox
@IAmTimCorey5 жыл бұрын
You are welcome. Thanks for linking that.
@harag95 жыл бұрын
Arrh, I read the comments after typing along with the video and paused it to go to the web page... But thanks for the link!
@danish41293 жыл бұрын
I am happy to see someone skilled and experienced stucking at minor issues because earlier i use to feel low if i face such issues but from now it wont effect me. Thanks alot Tim for such a great content. Learning alot from your tutorials.
@IAmTimCorey3 жыл бұрын
I am glad it was helpful. We all get stuck sometimes.
@desousamateus1145 жыл бұрын
"I am not against asking your questions on stackoverflow/google, but I am against doing it first. You should ask it only if you've already spent at least hours trying and testing things you might figure" Great words Wise Timothy!
@IAmTimCorey5 жыл бұрын
Thank you!
@tekneinINC3 жыл бұрын
I know I’m a little late to the game here, but I just wanted to share my appreciation for you leaving in that bit of debugging. I’m just just about to start applying for jobs after ~18 years of hobbyist programming, and just finishing up my BS in Software Development, and this video series has definitely given me a boost of confidence as you definitely seem like a great developer, and I find that a lot of the ways you go about planning, coding, and debugging is very similar to the ways I tackle things. Great channel!
@IAmTimCorey3 жыл бұрын
Thank you and welcome to the our industry. If you have not already, please check out my Dev Questions for questions related to the job search - kzbin.info/www/bejne/kKjbiHafjJqohZY
@talkathiriify5 жыл бұрын
Tom, I love the way you explain things,the way of solving a problem and simplified the codes Thank you very much for every effort you do
@IAmTimCorey5 жыл бұрын
You are most welcome. Thanks for watching.
@seanmcpadden18312 жыл бұрын
For anyone struggling with the LogIn button not doing anything. I changed the button name from x:Name="LogInButton" to x:Name="LogIn" and it worked.
@harryroper96595 жыл бұрын
Tim, thanks for another great video. I am so very glad you kept in the bit about the password glitch. I too have spent those frustrating hours you mention going back and forth between Stack Overflow and my code. It is very reassuring to know that someone as smart and experienced as you has these same issues from time to time. It is not just me! This kind of real life experience of a coder is one of the things that makes your videos so special. Keep it up. Harry Roper
@jimlynch83135 жыл бұрын
In relation to that, there's also this:stackoverflow.com/questions/47025669/why-does-the-caliburn-micro-explanation-not-work. Basically, "PasswordBox doesn't expose a dependency property for the entered password the framework can't bind the method input to the control." So, no matter what we did, the PasswordBox would have never worked on its own in the guard method.
@IAmTimCorey5 жыл бұрын
Yep, if you don't have problems, you aren't writing real code. Everyone runs into these issues. It is important to learn how to deal with them rather than just avoiding them.
@ua-deemon58134 жыл бұрын
I just love how you always stress that debugging is important, understanding what's under the hood is important. That's what makes difference between developer and GREAT developer! I'd also like to suggest to all devs not only get information from stackoverflow, but answer people's questions too! As i saw in the video, you do it, Tim, that's great! Thank you for what you're doing to help the community!
@IAmTimCorey4 жыл бұрын
Absolutely! And thanks for the tips.
@officialspock5 жыл бұрын
This is one of my favourite videos in this channel so far, Tim showing the code doesn't work and he doesn't know the answer and slowly debugging, googling, stackoverflow... this is my everyday life and I'm glad I'm not alone hahaha... I don't have enough money yet to be a patron but to help you I don't skip your ads and like all your videos, it's not much but that's whay I can do for now. Love your videos Tim, keep it up.
@IAmTimCorey5 жыл бұрын
I'm glad you enjoyed seeing the reality of what I go through developing an app. You aren't alone for sure. As for your support, what you are doing is more than generous. I appreciate it.
@Campesguy2 жыл бұрын
It was interesting to watch you fix the Caliburn passwordbox issue with the Login button but I wasn't a big fan of bringing in the Helper class and making additional changes to get it to work. IMO, it just seems to me if you have to jump through so many hoops then you were better off wiring up the button manually without relying on Caliburn, and that would have also resulted in less code and better readability.
@tomthelestaff-iamtimcorey75972 жыл бұрын
Reasonable perspective. The beauty and problem with programming is ... there are more than one way to get the job done. What you proposed may work best for your situation.
@rohanroy9818 Жыл бұрын
Wow, this session was so much fun..... Thank you Tim...
@IAmTimCorey Жыл бұрын
Glad you enjoyed it!
@johnhernandez28343 жыл бұрын
Thank you Tim, Amazing Video Im currently doing a project on WPF and was having difficulty with the Login Page. You Help alot and I Hope you keep going with KZbin videos and guide other young developers with your professional experience.
@IAmTimCorey3 жыл бұрын
Glad it helped!
@Tielc Жыл бұрын
Hi Tim, I really appreciate these start to finish courses, I'm learning new things every video as a hobbyist developer. This lesson however has left me scratching my head, especially when it comes to the implementation of Caliburn Micro. In all of my previous experiences using MVVM with WPF, I've created my ModelViews to expose my Properties (with INotifyPropertyChanged notifications) to my Views, and then I have used binding to bind those properties within my views. This has always allowed my ModelView to really not care about my Views (separation of model and view states). However, this tutorial felt like the way Caliburn seems to be implemented, there's a lot of coupling in the bootstrapper and magic strings (behind the scenes) that needs to take place. I didn't see any binding, but I am assuming this is happening auto-magically through fairly strict naming of your properties and controls was somehow auto-magically binding them? Does this come with any downsides in terms of performance? Like how did the Log In button even know to reference the CanLogIn property? Is this something where Caliburn requires that property to be predicated by Can and a matching Property Name (LogIn)? For example in the past I would create a property bool IsValue and I would bind that to Enabled on the button itself or through a DelegateCommand. Sorry if this is really long winded, this lesson just completely had me confused based on prior ways of doing this.
@IAmTimCorey Жыл бұрын
I have some videos on Caliburn Micro that might help. Basically, CM is using the naming conventions to do the binding automatically for you instead of manually doing the binding. There isn't a speed difference. I think the "coupling" in the Boostrapper that you are talking about is the dependency injection. That's actually a way to keep the coupling loose.
@Tielc Жыл бұрын
@@IAmTimCorey thank you very much for the quick reply. I’ve branched off from this series today to watch some of this content as well as your videos on reviewing other MVVM Frameworks as well. Thank you again for all of your content you make available.
@vadymnarchuk94224 жыл бұрын
Fixed errors in names and everything works! I love this quest! Thanks a lot for the course!
@IAmTimCorey4 жыл бұрын
You are welcome.
@mmushtaq9083 жыл бұрын
Hi @Tim, I am unable to understand the concept of "CanLogIn" . How it is bound to "Login" method? If I change "CanLogin" method name to something else like "Can_Login", "Login" button is not disabled. Can you please put light on it? Thanks in advance.
@IAmTimCorey3 жыл бұрын
That is a feature of Caliburn Micro (more info here: kzbin.info/www/bejne/opKzd6Rpe82mbs0 ). It uses naming conventions to match the validation check method to the button.
@Antonio-lt1sp2 жыл бұрын
Excellent question, I was lost here as well.
@bedocan15 жыл бұрын
Hi Tim, it is again a great tutorial. And I like that you didn't remove debugging process. Thank you
@IAmTimCorey5 жыл бұрын
You are welcome.
@krisculin96794 жыл бұрын
I'm loving this series so far. Even as a veteran developer, it's interesting to watch (or mostly listen to as I'm working). I know this video is over a year old but I do have a couple of comments. You've stated in the past that "!isAlive" could be considered less readable than "isAlive == false" (by a human). But you've used "UserName?.Length > 0" in your validation code. One could argue that "UserName?Length = 0" is not so readable by a human. Perhaps using "string.IsNullorEmpty(UserName)" would be better? This is definitely readable and explains exactly what it is doing. The method is asking "is this string null or empty?" and returns true or false. So your validation would be if (string.IsNullorEmpty(UserName) == false && string.IsNullOrEmpty(Password) == false) { ... }" Wouldn't that be more readable code than using UserName?.Length and Password?.Length? Also, the use of "?" is relatively new. If someone were to download your source code and open it in VS2015, it wouldn't compile because that compiler version doesn't recognize this syntax. (Yes, I know VS2015 is relatively old but perhaps that is all that is available to that developer). Thoughts?
@IAmTimCorey4 жыл бұрын
The difference here is that I am doing two things in this statement and doing a IsNullOrWhitespace would not work. First, UserName is an object so IsNullOrWhitespace would not apply (it isn't a string). Second, I am asking for the Length property. You cannot get a property of a null object. So, the equivalent statement would be "if (UserName != null && UserName.Length > 0)". The null check allows us to combine those statements into a more readable and yet still safe statement.
@nasben665 жыл бұрын
Hi Tim, great Video especially the debugging session it was good experience for me as I have came cross the same problem and now thanks to you I sort this password problem out, one thing I would highly recommend is that you use the MaterialDesign package with only few lines of code you get an awesome user interface
@IAmTimCorey5 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@SaveTheHedgehog4 жыл бұрын
Hi I don't understand how it's possible the button is disabled? It 's bind to x:Name="Login" (same as Model function) but the property is called "CanLogIn" which is bind to nothing. How does this work?
@IAmTimCorey4 жыл бұрын
Caliburn Micro does the wiring for a Can method for methods so CanLogin attaches to the enabled property of the Login button. I believe I cover that in this video: kzbin.info/www/bejne/opKzd6Rpe82mbs0
@harryperales5 жыл бұрын
nice video, really good for people starting with WPF. I had the same problem trying to get on the WPF boat 2 years ago coming from a long time of winforms development, and it was really difficult figuring out bindings and xaml errors and DI so i stopped. Your video series rekindled my interest in wpf, always on the watch for new videos every monday :)
@IAmTimCorey5 жыл бұрын
Excellent!
@harag95 жыл бұрын
Same here, long time winforms dev, and that is my day job, looking after a large winforms application - I'm finding it difficult to figure out the bindings & DI in these vids, but Tim explains things so well I'm sure it will sink in... Though I doubt I will be using WPF in my day job.
@sc1002000904 жыл бұрын
Definitely Caliburn turned out to be great! Excellent buddy!
@IAmTimCorey4 жыл бұрын
Thanks!
@ben.thornhill5 жыл бұрын
Great debugging wisdom Tim! Thanks another awesome video, I am really liking this series.
@IAmTimCorey5 жыл бұрын
You are welcome.
@GabrielMariusPopescu3 жыл бұрын
Thank you Tim for this course... it's great!
@IAmTimCorey3 жыл бұрын
You are welcome.
@dyachenkoserj5 жыл бұрын
This leson is more about debbuging and this is great. Please continue teach in this style. By the way, how did parameters pass in LogIn method?
@IAmTimCorey5 жыл бұрын
That is Caliburn Micro wiring up the parameters by naming convention.
@williambell45914 жыл бұрын
I HIGHLY recommend Stylet MVVM over Caliburn - it’s inspired by Caliburn, but much simpler to grasp / use, and I didn’t have these issues wiring up the password screens I’ve created for my applications.
@IAmTimCorey4 жыл бұрын
I'll look into it. Thanks for the suggestion.
@andrewthompson97144 жыл бұрын
I found out that resharper supports the auto generation of public properties from a field using the NotifyOfPropertyChange(() => PropName), so it supports caliburn micro out of the box. Very neat.
@IAmTimCorey4 жыл бұрын
Nice!
@dumdahdum Жыл бұрын
for those wondering at 30:01 if you are not seeing the form for logging in make sure you are using an older version of caliburn before v 4. also make sure your classes are public. if you have newer version of caliburn than him your activateitem will be async and nothing will work.
@IAmTimCorey Жыл бұрын
Thanks for sharing.
@berkerozgur6517 Жыл бұрын
I am using v4 and async but it works for me. Will it be a problem in the future?
@joannagechanfon47708 ай бұрын
@@berkerozgur6517 I am using caliburn 4 but I don't know what I am doing wrong , I change protected override async void OnStartup(object sender, StartupEventArgs e) { await DisplayRootViewForAsync(typeof(ShellViewModel)); } But I can't see the loginView , Can you help me please
@petrhavlat51594 ай бұрын
@@joannagechanfon4770 remove typeof operator.. await DisplayRootViewForAsync(); this works for me
@milanmladenovic5 жыл бұрын
Thank you Tim. Grate video as always.
@IAmTimCorey5 жыл бұрын
You are welcome.
@alexn42173 жыл бұрын
I am using Caliburn.Micro nuget package v4.0.136 and it seem like they replaced the ActivateItem() method with a property called ActiveItem, so in my ShellViewModel constructor I had to set the ActiveItem property to the loginVM private property. The login screen is the first form that gets launched and the rest of the code seems to be working as expected. Thanks for doing this series, Tim. It's great!
@IAmTimCorey3 жыл бұрын
I would recommend backing up the version of Caliburn Micro a bit until we upgrade to .NET Core. Then we will cover those changes. Glad you are enjoying the series.
@alexn42173 жыл бұрын
@@IAmTimCorey That's exactly what I did!
@dreamysap3 жыл бұрын
I could only see ActivateItemAsync. So I used it. Ofcourse that meant I couldn't await it in constructor so I had to move to an awaitable method. Add property and use Initialization = InitializeAsync(); in constructor.
@perceptron49584 жыл бұрын
I found the same answer on s.o. After I couldn't solve the same problem myself I found this video. =)) Thx!
@IAmTimCorey4 жыл бұрын
Awesome!
@PelFox5 жыл бұрын
I did it slightly differently. Instead of checking the length and if the property is null you can use the string.IsNullOrEmpty() method. public bool CanLogIn => !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password);
@IAmTimCorey5 жыл бұрын
Yep, that will work.
@aminebenhebba18914 жыл бұрын
One of the best serie i could find, a real problems and how to solve them Live, you make this world a better one. Thank you sir for all your hard work. public bool CanLogIn { get { return !String.IsNullOrEmpty(UserName) && !String.IsNullOrEmpty(Password); } } Would realy like seen a MVP project implemented using caliburn.micro if it can be (i'm kinda confused betwin MVVM and MVP seems to me the same deal).
@IAmTimCorey4 жыл бұрын
In MVP, the view and the presenter are much more closely tied together. We don't really do MVP in WPF.
@Jason-Woolf Жыл бұрын
Around 40:00 I didnt want to add the helper it looked to messy - I change the PasswordBox back into a standard text box and the original example works fine - so I am guessing its the Caliburn system that doesnt like PasswordBox - there must be a setting somewhere to include that type - I will update if I figure it out
@gordonhope92193 жыл бұрын
Tim, I am retired and never employed as a programmer but have been around software since I was 16 and written some simple apps in VB.NET under Windows Forms. I am learning a tremendous amount of info from walking through your Timco Retail video series, (I never walked through WPF for example) but there are a couple of challenges (for me anyway....) that I may need guidance on. 1) My version of VS 2019 Community is more recent than when this video was created so for example getting rid of the tools on a XAML form through the General Settings under debugging is no longer in the same location as shown in the video, no biggie. I tried digging around but cannot find where the setting was moved, just a minor challenge. However, 2) When I installed VS, since it was targeting the .NET framework, the version of C# is set at 7.3 and Microsoft does NOT recommend upgrading it to 8 or higher for targeting the .NET framework. Why do I bring this up? In your PasswordBoxHelper class, where you moved over code from Stack Overflow, there are many areas where public static or private static declarations were in the method statements and the code will not compile - in each instance of a declaration, it simply says in so many words, upgrade to 8.0 C# as it is not supported in 7.3. What might you recommend at this point?
@mottahh41625 жыл бұрын
The reason i'm against using a framework for the mvvm is this, if i make my structure i know immediately why this isn't working, otherwise you need to trust other and try to understand how were they thinking to debug
@IAmTimCorey5 жыл бұрын
I understand the reasoning but I don't go that far. Just like I don't build my own MVC framework for web applications, nor do I build my own logging framework. At some point, you need to stand on the shoulders of giants. Otherwise, you spend all of your time getting plumbing to work while the "real" application waits to be launched.
@TysonGibby4 жыл бұрын
Tim, I am new to your videos and your Patreon. It is great to be here. Thanks for your excellent videos. In this video you had a null object issue that you solved by adding a "?" to the end of the "UserName" and "Password" variables. It was my understanding that this simply made a "non-nullable" variable, nullable. If this is a null check instead, can you give us more info or a reference on how it works? I have been searching for an answer and I have come up short of getting one.
@IAmTimCorey4 жыл бұрын
This is a newer feature of C#. What you are thinking of is something like int? which indicates that the variable can be nullable. In this case, what it does is a null check. So myPerson?.FirstName first does a null check on myPerson. If it is null, it stops there. That way we don't get a null exception when trying to access the property of a null object. Here is more info: docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-
@TysonGibby4 жыл бұрын
@@IAmTimCorey Thanks Tim!
@WaqasAli-ev7ge5 жыл бұрын
Thanks for the nice video. Waiting for the next video.
@IAmTimCorey5 жыл бұрын
Thank you!
@daliangilbert2 жыл бұрын
Do you know Tim instead of changing background color 13:28, you can just set design background to white with one of tiny icons between xaml and view. No need to thanks :-)
@dionkllokoqi69813 жыл бұрын
Great Video! A question I would have is, how does the Login button KNOW that after CanLogIn returns true, it can be pressed? I cannot see any direct connection between these two behaviors? CanLogIn also doesn't seem to be some Overriden method or property of Caliburn Micro that has some kind of wire up behind the scenes. Thanks!
@IAmTimCorey3 жыл бұрын
That is part of what Caliburn Micro provides us with. I believe I explain it more here: kzbin.info/www/bejne/opKzd6Rpe82mbs0
@christopherkenn533 жыл бұрын
@@IAmTimCorey at 57':35" you explain about Caliburn "Can" + "ClearText method name property. So I see the link to Can + LogIn method tied to the xaml "LogIn" button on the LoginView. I'm having a tough time finding the "Can" prefix approach in Caliburn documentation.
@siddgoen3 жыл бұрын
Regarding the password box problem, the actual problem is that the Password property of PasswordBox control is not a dependency property; it's just a CLR property. That's the reason, it is not bound to the Password property of the viewmodel. The solution is to create an attached property which can be bound to the viewmodel's Password property and then use this attached property in the PasswordBox control. Through the attached property, we need to interact with the Password property of the Password Box control. This is illustrated here - www.codemag.com/article/1405061/XAML-Magic--Attached-Properties.
@talkathiriify5 жыл бұрын
Thank you very much Tom you are a wonderful
@IAmTimCorey5 жыл бұрын
You are welcome.
@AntonyJudes5 жыл бұрын
Thank you Tim. Interesting.
@IAmTimCorey5 жыл бұрын
You are welcome.
@AthensDotNet5 жыл бұрын
I followed along with the code but could not see where the Login Button is set to disabled. My code was identical (as far as I could see) to yours but my button was always enabled. When I pasted your code over mine it worked. Mystery. Great series by the way.
@IAmTimCorey5 жыл бұрын
Must have been a small difference somewhere.
@harryperales5 жыл бұрын
double check on your casings, most likely your not using the proper casing and caliburn micro cant figure out the binding
@V4MP_4EVA10 ай бұрын
Great videos it helped me a lot thanks
@IAmTimCorey10 ай бұрын
You are welcome.
@harag95 жыл бұрын
Great video, though for now I think I'll stick to winforms, though WPF looks good. I'm finding it difficult to get my head around what calls what and how does it know what parameters to pass in, e.g. The LogIn(u,p) function you had I still don't understand how it knows to pass in the username & password, or how it knows to enable/disable the button - guess it's all to do with Caliburn. Though it was interesting to see. As for stackoverflow code - one thing I would like to stress is when you copy/paste code - Look at it, analyse it, and check it. Learn to understand what it's doing, and why. Glad you kept the debugging session in though. :) Thanks!
@IAmTimCorey5 жыл бұрын
Agreed on the copy/paste. I wasn't as explicit as I should have been but I reviewed the code before just plunking it into my project.
@beautifulheartsoothingreci283 жыл бұрын
Absolutely brilliant, thanks! I think "!String.IsNullOrWhiteSpace(UserName)" would probably even be a better check than "Username?." for form input like username :D
@IAmTimCorey3 жыл бұрын
Interesting, thanks for sharing.
@desousamateus1145 жыл бұрын
Tip: When duplicating lines, you can do "Ctrl+D" it will duplicate the line, instead of doing "Ctrl+C" + "Ctrl+V".
@IAmTimCorey5 жыл бұрын
Not in Visual Studio (at least not by default). That command is "Ctrl+E, V" and it places the line right below the current line. I have a hard time remembering the shortcuts and that one doesn't seem to add that much value so I just do copy/paste or cut/paste.
@desousamateus1145 жыл бұрын
@@IAmTimCorey Funny, I recently downloaded VS19, havent downloaded any kind of extension.
@desousamateus1145 жыл бұрын
@@IAmTimCorey "To solve this issue, we introduced Duplicate Code (Ctrl + D) in Visual Studio 2017 version 15.6 which streamlines the process of duplicating your code while leaving your clipboard untouched. If nothing is selected, Ctrl + D will duplicate the line the cursor is in and insert it right below the line in focus. If you’d like to duplicate a specific set of code, simply select the portion of code you want to duplicate before invoking the duplicate code command." devblogs.microsoft.com/visualstudio/improving-your-productivity-in-the-visual-studio-editor/
@BristlyBright5 жыл бұрын
@@desousamateus114 Nice! Thanks for the tips! Very helpful.
@babaniyiiyanu34255 жыл бұрын
Hi Tim, thanks for the awesome series! Tim, I have followed through every video and have a working project so far, except for this specific video, where the login button is not behaving like yours ( not greyed out upon starting the app). Tried using breakpoints to find the problem and realized the password is coming through.
@IAmTimCorey5 жыл бұрын
Not sure what you mean by "the password is coming through". My guess as to why it isn't greyed out is because there is a naming issue of some type.
@ericjurotich90784 жыл бұрын
At 30 min , I am still only getting File and Account displaying, not the LoginView we just created like what I see in the video. Any ideas what I might be missing.
@ericjurotich90784 жыл бұрын
Nm, I figured it out. I had typed instead of the correct code which is in ShellView. It works now!
@IAmTimCorey4 жыл бұрын
Yep, those little details will get you.
@FenelHyacinthe4 жыл бұрын
Type exact same thing itxs not work for me, send me to method in the bootstrapper OnStartup, that DisplayRootViewFor should be the root of tree, cannot add window as a child. When i change AcitveItem to Activeitem or ActivateItem it show but don't see the login.
@njogusamuel4 жыл бұрын
@@ericjurotich9078 Had made the exact same error. Almost ruined my afternoon. Thanks a bunch!!!
@joeyjoeyjojo89384 жыл бұрын
Same error and overlooked that tiny difference. It took a few minutes of scrolling but I knew I'd find a solution eventually :P
@AkshayKumarTK4 жыл бұрын
Roller coaster of a video :D A suggestion: If you reference some article/blog, kindly put the link in the video description. It is really a shame that the example that is given on the main page of Caliburn Micro site doesn't work by default. Also, a couple of questions: 1. NotifyOfPropertyChange(UserName) vs NotifyOfPropertyChange(() => UserName). What is the difference? 2. I suppose the Can() and the () method mimic the functionality of the CanExecute and Executed dependency Property, is it?
@IAmTimCorey4 жыл бұрын
Open source is hard. Trying to maintain moving forward in the code while also moving forward in the documentation is a big task. I try to document a lot of CM via video partly as a way to help the team out. As for the difference between those two notifications, they are essentially the same. The team added an overload to the method that allows you to pass in the property name. It will convert it (I believe using reflection) to the actual property. I believe there is a slight performance hit but I'm not positive (haven't benchmarked it, just basing it off of my assumptions, which could be totally wrong). As for the mimicry of CanExecute, yes, this is a similar pattern.
@WolfJustWolf5 жыл бұрын
A bit too much "magic code" for my liking. But this series has introduced me to a lot of things i would never have used otherwise. But i doubt i'll ever use Caliburn Micro again after this.
@IAmTimCorey5 жыл бұрын
This definitely isn't an intro to Caliburn Micro (that's another video on this channel - WPF with MVVM). This is a more advanced series that uses a lot of advanced OOP ideas. That lends to a lot of magic if you haven't learned how they work at a lower level yet. I would definitely recommend learning more about it.
@JoshyHJoshy2 жыл бұрын
Around 32:00 I realized ActivateItem is no longer available, and should be replaced with ActivateItemAsync, but that does not activate the login view window; only the shell view window pops up. Has anyone come across this? That would of course require turning the constructor into an async Task which does not work either. Could someone please help me understand what is going on and how I can fix this? Thank you
@IAmTimCorey2 жыл бұрын
Revert your Caliburn Micro back to the latest 3.x version. We are still in the .NET Framework portion of the course in this video. Once we get to the place where we upgrade the project to .NET Core, we will upgrade Caliburn Micro to 4.x, which will include moving everything to Async (that was a breaking change, as you found out).
@JoshyHJoshy2 жыл бұрын
@@IAmTimCorey Perfect! Thank you Tim. Resolved :-)
@joannagechanfon47708 ай бұрын
@@IAmTimCorey Thanks god I found this suggestion because I spend more than 3 hours trying to fix it
@bhuriwataunguranun63717 ай бұрын
@@IAmTimCorey I've tried to downgrade version of Caliburn.Micro from 4.xx to 3.xx but it doesn't work.
@benli73482 жыл бұрын
userName/ password started with upper case, while they are lower case in viewmodel
@mahfoudbouabdallah62864 жыл бұрын
Dear Tim My name is Mahfoud and I am from Algeria. I cannot find enough words to express my gratitude and thanks to you. Also, please accept my apology, because I do not have the money to be a member of patreon. I do not even have a credit card, but make sure that this debt is on me and I will repay it. In my project, I want to go with the ribbon and taskbar (multiple tab like visual studio) I would be grateful if you could make a video about that or guide me to the right place. Sorry for my English.
@IAmTimCorey4 жыл бұрын
No debt at all. I'm happy to have helped. The people who buy courses and support me on Patreon help make this possible. The purpose is not to get people to pay, the purpose is to use the payments to enable the free content. I am glad you can use the content and grow. Thanks for the video suggestion. I will see what I can do.
@giaccommander74743 жыл бұрын
I was just visiting my old friend Tim while searching for ADFS Login Logic. Although it was not exactly what I was looking for I am glad that I kept the video running ... When I heard that he started to have the Error I got invested. I still wonder what was going wrong... Maybe it´s the way how Passwordboxes are delivered in System
@IAmTimCorey3 жыл бұрын
I'm glad it sucked you in.
@mcdls53 жыл бұрын
@@IAmTimCorey That's what she said.
@mottosson5 жыл бұрын
Yeah, mysteriously non working elements and bindings solved with a wall of code from StackOverflow pretty much sums up my experience with MVVM and Caliburn.Micro... Latest project I switched back to code behind :(
@IAmTimCorey5 жыл бұрын
Well, it is something that could use more documentation (which is something I'm working on in video format) but I've not found this situation to be very common.
@maciej_s4 жыл бұрын
1:01:59 The "CanLogIn" can be simplified to: public bool CanLogIn => UserName?.Length > 0 && Password?.Length > 0; Which in my opinion makes for a much more readable and simple to use code :) Thank you for all your hard work! I am really enjoying your videos!
@IAmTimCorey4 жыл бұрын
That would definitely work. The issue is it doesn't leave room for easy expansion.
@PelFox5 жыл бұрын
After doing a lot of web development the margin/padding confuses me. CSS applies it Top, Right, Bottom, Left. But here it's Left, Top, Right, Bottom.
@IAmTimCorey5 жыл бұрын
Yeah, that is confusing.
@TheMessixaviniesta5 жыл бұрын
I think this one of the few things where CSS makes sense.
@donybg5 жыл бұрын
Just spent 30mins trying to guess what I did wrong because the login view was not displayed. Read through Caliburn micro documentation on DI, tried to break it, fix... and just when I was getting close to rethinking my choices for the pat 7 years, and probably changing career, I realized that I typed Activeitem instead of ActiveItem in the shell view xaml. How can I debug such errors? It's more like typos but it can be really annoying. Another great video by Tim. I really like his approach and the way he explains. Tim, will you consider teaching a group of several people on-line, in some sort of interactive class with 10-15 people? Paid course, of course. Just a suggestion. I know you are a busy man, and I really appreciate that you give a portion of your time to create this videos. Thank you!
@IAmTimCorey5 жыл бұрын
It is something I've considered. I would want to do it well though. Still working through how to do it.
@jonestako47215 жыл бұрын
thanks
@IAmTimCorey5 жыл бұрын
You are welcome.
@davidbatista25512 жыл бұрын
Hi Tim my ActivateItem method is not working is it obsolete?
@IAmTimCorey2 жыл бұрын
If you are using the newer version of Caliburn Micro, there is now an Async version. You can downgrade to the same major version I use for now. We will upgrade it later. Or you can use the Async versions of things and use the latest Caliburn Micro.
@dalewolver87393 жыл бұрын
I really hate invisible black magic. So what actually causes the Login button to become enabled? How is CanLogin associated to the Login button? Is this a trick of Caliburn?
@IAmTimCorey3 жыл бұрын
This is something Caliburn Micro does for us. I explain it a lot more in this video: kzbin.info/www/bejne/opKzd6Rpe82mbs0
@bobi97495 жыл бұрын
Hello Tim, Thanks for the Video. Why are most Desktop Applications that use OAuth2 opening a Browser to Login and than redirect back to the App instead of a Login form like we did now?
@IAmTimCorey5 жыл бұрын
Added security mostly. The only way you can get a token from Twitter/Facebook/etc. is to actually go to their site and request it. If they allowed us to pass through a username and password, we could be capturing those values before passing them on. Then we would know what the user's login info is, which is not secure. The minor reason is because then they can control the UI (their correct logo, they can show what permissions you are granting, etc.)
@bobi97495 жыл бұрын
@@IAmTimCorey Thanks alot! You are the best
@kemmrich5 жыл бұрын
I have everything working as expected, but I cannot figure out the three things below. Basically, I just can't see the connection between the button (x:Name="Login" in LoginView) and the code in LoginViewModel LogIn(). The casing doesn't line up, there is no click event -- I am confused on this one. I watched the video once to see what was going on and then a second time to code along with you. Maybe I missed that explanation. 1.) Why is the Login button disabled to begin with? 2.) How it becomes enabled? 3.) When I click on it, how does it fire the LogIn() method in LoginViewModel.cs?
@IAmTimCorey5 жыл бұрын
This is how Caliburn Micro works. It uses convention to wire up our ViewModels (VM) with our Views. So, if you name a button RunReport, CM will look in the VM to see if there is a method called RunReport. If there is, it will connect the two. CM will then look to see if there is a property or method called CanRunReport that returns a bool. If there is, it uses that method to determine if the button is enabled or not. If you are new to Caliburn Micro, this video should help: kzbin.info/www/bejne/opKzd6Rpe82mbs0
@kemmrich5 жыл бұрын
I figured it was caliburn micro, but I was thrown off by the "casing". My login button is named "Login", but the method is "LogIn()" (along with CanLogIn()). Should my login button be renamed to x:name="LogIn" to match casing even though it doesn't seem to matter? I might have watched that MVVM video before, but if I did, I need to watch it again! Thanks for super fast reply! Edit: I just re-checked this video and you have x:name="LogIn" -- I wonder why mine is working with incorrect casing?
@timothywestern64885 жыл бұрын
I encountered the same issue with the Login button actually enabled by default. So it never is disabled to begin with. So when he was debugging I was trying to see what I'd done that had turned it on. I went back through the lesson, and I made sure the name was formatted as LogIn and suddenly it was disabled. I'm not sure why walking through this a second time fixed the problem of it being disabled though.. I do believe that for this to work the case of the label on the control, its name, has to match the methods. Initially mine waas Login and LogIn respectfully... (although I saw something similar where LogIn was catching it, and my only thought is that I cleaned and rebuilt the solution which might have fixed the reference.
@timothywestern64885 жыл бұрын
Went back and checked my undo, and I had it named right in the Form, but named Login and CanLogIn on the other.... so I finally got that to work and am now debugging the issue with password not coming in correctly.
@Rothbardo3 жыл бұрын
What makes the Log In button greyed out before validation? How is that working?
@IAmTimCorey3 жыл бұрын
That is the automatic wire-up of the CanLogIn to the button's enabled value. The method checks to see if you are allowed to log in and either enables or disables the button. Caliburn Micro handles the wire-up by naming convention.
@Rothbardo3 жыл бұрын
@@IAmTimCorey Thanks! One last ?, do you know where the enabled value is set in the video?
@vishalsaraganachari16044 жыл бұрын
Great tutorial Tim I think, Interface(ILoginViewModel) would have been better in LoginViewModel constructor
@IAmTimCorey4 жыл бұрын
I am not sure what you are referring to. You want to ask for the ILoginViewModel in the LoginViewModel constructor? That is a circular logic that could cause an issue.
@EndeXlol2 жыл бұрын
I have problem with 'using Caliburn.Micro;' it said 'The type or namespace name 'Caliburn' could not be found (are you missing a using directive or an assembly reference?)'
@IAmTimCorey2 жыл бұрын
Did you add the Caliburn Micro NuGet package? Is it the same version that I added?
@danielpatfield47794 жыл бұрын
Hey Tim: I see that we have some pretty complex stuff going on in Caliburn Micro, and that's great. But again I pose the question (as I would with any useful tool - Swagger, Caliburn Micro, PostMan, etc...) , as I am trying to learn app development and get a job that does NOT use these tools, and many will not, is there a way to understand the connections that NEED to be made, if Caliburn Micro (to use an example) was not implemented? As a software developer, I GET that I need to figure things out and have a good structural knowledge of how things work, but Caliburn Micro (again as an example) has some pretty complex behind-the-scenes code going on. If it wasn't implemented wherever I end up working, what would I need to understand (and where would I see it in the VS solution/project(s) - being implemented)? Does that all make sense? I can clarify if need be!
@danielpatfield47794 жыл бұрын
To user a more specific question as an example: I see you created a CanLogIn property. And you have a Login method. Is CanLogIn an overridden property from Caliburn Micro? Is the Login method tied to the login button we created? If it is - how? It's a void, so I don't see where it would be enabling the button.
@IAmTimCorey4 жыл бұрын
Caliburn Micro basically does a lot of binding for us automatically so if you didn't want to use it, you would need to do the binding by hand instead. For instance, the CanLogin is bound to the enabled property of the button. The Login is bound to the click event.
@danielpatfield47794 жыл бұрын
@@IAmTimCorey Thanks. That's what I figured. Do you have any courses out there that focus on binding and accomplishing these things without CM? ;-)
@alexaprodu53464 жыл бұрын
Subscribe to Daniel Comment, i would like also to know more about how connections are made and so on, at least theoreticaly mentioned, i know for you makes alot of sense, but i also had problems understanding how these bind together and why.
@Rothbardo3 жыл бұрын
I found myself not really comprehending how exactly the view and viewmodel link up and really just copied what i saw for most of this video.
@tomthelestaff-iamtimcorey75973 жыл бұрын
Several folks have mentioned they had to watch a couple times before they got the 'ah-ha' moment.
@edikbaghdasaryan76565 жыл бұрын
Thanks for such a significant content. Why not to use datatriggers for login button enabling instead of that whole staff in viewmodel?
@IAmTimCorey5 жыл бұрын
This is how Caliburn Micro and MVVM are configured. The code is in the ViewModel and separate from the view.
@ladoleskovec2815 жыл бұрын
Hello, Tim. You wrote that you reviewed and understood the StackOverflow code before pasting it into your project, but I'm not sure everyone understands what it does or why it's needed. Well, actually, I know I don't understand it... If you could in one of the future videos touch this, I'd really appreciate it. I'm quite wary of using the code without understanding it, but on the other hand I fear I won't be able to follow your course without it. As for why it's needed, I read about some comments on that page and followed a few links. Seems it's a security issue if password is passed into a variable as that way it's stored in memory (source: stackoverflow.com/questions/1483892/how-to-bind-to-a-passwordbox-in-mvvm?rq=1 ). Because of this issue WPF seems to be blocking it, hence we need a workaround if we want to use it nonetheless, which accepted answer in above link strongly discourages. Reading some more about this topic, however, I stumbled on another great read: security.stackexchange.com/questions/29019/are-passwords-stored-in-memory-safe . This gives me some hope that it's not as critical for small scale applications that you don't expect to be a heavy hacking target, but one should probably refrain from using it on larger scale projects. Also, a huge THANK YOU for all your videos. I really feel I learned a lot since discovering your channel.
@IAmTimCorey5 жыл бұрын
I will add that to my list of things to cover in a future video. It sounds like it should be a good discussion. Let me at least cover the basics here. I think this is a bit of gnat straining. Yes, ideally you would never store the user's password in clear text in the memory. However, if someone has access to read your RAM, you have bigger issues. A keylogger would be easier to use and just as effective. We are just fine with this solution (even at a much larger scale).
@buddyrowe74604 жыл бұрын
What about using a TextBox for password and setting foreground color attribute to null?
@IAmTimCorey4 жыл бұрын
That might be an option.
@artydooty16753 жыл бұрын
Late reply I know but this is a really bad option. First, you can copy out of a textbox, but copy function is automatically disabled on a passwordbox. Secondly, why would you bodge a textbox to do exactly what a passwordbox already does? Makes no sense - there are many reasons why someone went to the trouble of creating a passwordbox - use it!
@aaronpaul25503 ай бұрын
I love you
@IAmTimCorey3 ай бұрын
Thanks!
@PamelaLoveland3 жыл бұрын
As I'm working through this retail manager, I'm wondering if WPF is still commonly used? I'm getting a lot of good info regardless, I'm just curious. If not, what else do you consider popular? I know that could be a LOT of thing, and in my position Angular is being used more frequently.
@IAmTimCorey3 жыл бұрын
For desktop apps, WPF and WinForms are the most common.
@PamelaLoveland3 жыл бұрын
Thank you!
@christopherquinn18792 жыл бұрын
Just restarted this great course went to Patreon to find the source code and could not find it I have the 5 dollar membership. Thank you
@IAmTimCorey2 жыл бұрын
The $5/month Patreon subscription was for when the series was being developed. Now that the series is over, the code is part of the paid course on www.IAmTimCorey.com. The Patreon membership was never designed to give you three years of source code for $5. Sorry.
@christopherquinn18792 жыл бұрын
@@IAmTimCorey Thank you will the monthly membership open soon and that will include all 3 phases of the course?
@IAmTimCorey2 жыл бұрын
It opens a few times per year. If you are on the mailing list, you will hear when it next opens up. And yes, all publicly available courses are included in the All Access Pass. That includes all three phases of the TimCo Retail Manager.
@SuperDre744 жыл бұрын
LOL, the easiest way without all the helperclass would just be using a Textbox with a font which only consists of dots (make sure you add it as a resource, so it's definitely on the system). less hassle with having to use a real workaround with the helper and the bootstrapper (and as you saw, it still needs a heel of a workaround to get it to work).
@IAmTimCorey4 жыл бұрын
That would be different. You can copy a font and paste it somewhere else to display it. While the user probably won't walk away after typing it out, it is a security issue you don't need to introduce.
@SuperDre744 жыл бұрын
@@IAmTimCorey I agree with that, best would have been for MS to have made a textbox work like in Windows itself, where you can set a password character so even if you did copy it you wouldn't have the original typed text. IMHO a big mistake from microsoft of not giving us the option. I hate forced crap where you have to deal with other problems and have to work around making it just as insecure as not using it.
@dkxc324e4 жыл бұрын
good thanks
@IAmTimCorey4 жыл бұрын
You are welcome.
@alfonsdeda8912 Жыл бұрын
Hi Tim, thank you for your effort in your videos. The binding of Password doesn't work even if i have done your same operations. This in net 6. Have you got any idea to solve? Thanks in advance.
@hans-ee4 жыл бұрын
I'm having a problem at 30:00. When I run the application, the ShellView window appears with the dockpanel menu items as it should, but LoginView isn't there. I triple checked every line we've written (it's indeed "
@IAmTimCorey4 жыл бұрын
Yes, that is probably associated with your issue. You shouldn't need to add that line because the line that starts "GetType().Assembly" adds all of the ViewModels to the container. It sounds like that line is messed up.
@housemashups40155 жыл бұрын
Oh Tim, do you know which code is necessary to call a vb.net form in C#? And vice versa.
@IAmTimCorey5 жыл бұрын
If you put your C# code in a library, your VB.NET code can add that library as a reference and just use it. The opposite is true as well.
@housemashups40155 жыл бұрын
@@IAmTimCorey Thanks! Now my app is almost finished!
@westblueconsulting46024 жыл бұрын
Thank you for this great explanation. Please, can you explain why you need these two statements? NotifyOfPropertyChange(() => UserName); NotifyOfPropertyChange(() => CanLogIn); Can't we just use the last one to get notified about the change event since it is checking both fields? I am very new to WPF so sorry if it's a stupid question
@IAmTimCorey4 жыл бұрын
Not a stupid question. The reason we have both is because it isn't just the Login button that we are informing of the change. There might be a control that uses the UserName value. By alerting the system that the UserName has changed, will alert everything that depends on it.
4 жыл бұрын
Hi Tim, First of All Thanks for your videos!! they were a great help to me. Is there any way to add a placeholder to the textbox / passwordbox?
@IAmTimCorey4 жыл бұрын
Yes, I think there is, but I don't have a code sample to point you to.
@linoyyarkoni6177 Жыл бұрын
Hi First of all, thank you for sharing your knowledge and experience !! I have a question about Caliburn Micro since it is no longer supported - as for your experience, is this relevant in the industry?
@IAmTimCorey Жыл бұрын
Caliburn Micro is supported again. It wasn't for a while, but now it is back with a new, larger team of maintainers.
@Prim3MavericK4 жыл бұрын
Hi Tim, I was wondering if you can help me. At 57:45, you got values into your 'username' and 'password' variables but when I debug my code neither 'username' nor 'password' has values inside even when I check "NotifyOfPropertyChange()" it doesn't return any values. SOLVED: .xaml values were changed from 'userName' -> 'UserName' and 'password' -> 'Password' ... that's so mean.
@IAmTimCorey4 жыл бұрын
Ah, that will do it. I am glad you figured it out.
@kkarol19833 жыл бұрын
Hi Tim, Thank you for the great video. I know it's has been a while, but if you still read the comments maybe you could explain why do we use NotifyOfPropertyChange(() => Password), I'm mean notification of the property change that calls the same property. I understand if on the Password property change we call CanLogIn property that makes sense. I did my research and CaliburnMicro page shows the same example, but I also commented out lines in question and it still works. I don't like the idea of having code that actually doesn't do anything. Thanks a lot.
@IAmTimCorey3 жыл бұрын
NotifyOfPropertyChange tells MVVM that the property has changed. This allows other things to react to that change. For instance, we can disable the login button until both the username and password fields are filled out. We are alerted to their change in status by this trigger. That way, we can have the button update to enabled when both are filled in.
@kkarol19833 жыл бұрын
@@IAmTimCoreyMVVM is the key here and your video 'WPF in C# with MVVM using Caliburn Micro' leaves no doubts on how to use it. Thanks, Tim.
@brewandrew3 жыл бұрын
Hi. At 29:57 when I hit Start to see if it works, visual studio tells me that ShellViewModel doesn't have a default parameterless constructor. Why's that happening and what should I do? Thank you!
@IAmTimCorey3 жыл бұрын
It sounds like you are trying to launch ShellViewModel directly instead of using the Dependency Injection system. Try looking at app.xaml to see if you missed some settings.
@rayt68674 жыл бұрын
My button is always enabled, how to set the button to disable? This is so confusing when there is code behind the scenes doing what a click event would have suffice.
@IAmTimCorey4 жыл бұрын
We are using a click event behind the scenes for the button click. It is just that we are binding it to a method in our ViewModel rather than putting it in our code-behind. This provides a more disconnected architecture. As for setting the button to be disabled, the "Can" property or method needs to be added and return a true or false value for whether the button should be enabled. These videos, especially the MVVM in WPF video, might help you have a better understanding of what is happening: kzbin.info/aero/PLLWMQd6PeGY3QEHCmCWaUKNhmFFdIDxE8
@rayt68674 жыл бұрын
@@IAmTimCorey Thank you very much for taking your time to help me out, I really appreciate it, I will watch the video, but I think that this tutorials are for a more seasoned developer which I am not.
@shaswatsoni32284 жыл бұрын
Hey Tim, why is there a need to use reflection? ( I just know that it helps with late binding, I mean if you don't have knowledge of classes on compile time, Reflection helps)
@IAmTimCorey4 жыл бұрын
Can you point to where the reflection is used (time code)? I don't remember using reflection.
@bagietmajster85895 жыл бұрын
Hello, if your struggling with this video because "too much magic code" i recommend to watch this: Dependency Injection: kzbin.info/www/bejne/o3S4f6WIqbuJjbs and MVVM using Caliburn Micro: kzbin.info/www/bejne/opKzd6Rpe82mbs0 Helped me a lot with "magic part" of video, maybe not in 100%, but i think 80% to even 90%.
@IAmTimCorey5 жыл бұрын
Yep, those are definitely the foundation we build on.
@sneakybeard4 жыл бұрын
I got stuck on getting the login button bound to the CanLogIn method. No matter how I named things, the login button was always disabled. I finally figured out that giving CanLogin parameters was causing it to not get called. I was thinking, damn that was just a lucky guess. When there's so much magic behind the scenes, it becomes incredibly difficult to debug, and you get caught up trying to fix the most simple things. It gets really discouraging.
@IAmTimCorey4 жыл бұрын
I can definitely understand that. That is one area that CM is a bit too magical.
@aminebenhebba18914 жыл бұрын
a good thing to do when using a library, is always to read its documentation, just a bit it will save you some debuging time and give you an overview, its always a good thing to do speacialy when its magical.
@housemashups40155 жыл бұрын
Hi Tim! I am using C# language to authentate my app. Now when logged in it need to call a vb.net application which is the actually application whats is all about. Do you know how I can call that app in C# ? Btw love your video's, very clear!
@IAmTimCorey5 жыл бұрын
A whole application (like an EXE) or just code? Because C# can call VB.NET code libraries without an issue. Calling the EXE, though, is a bit more tricky. You would launch it like you would launch any application from code (Process.Start() I believe).
@housemashups40155 жыл бұрын
@@IAmTimCorey Yeah it need to call the vb.net code. And also the vb.net need to call the C# code.
@onyebuchiboss5 жыл бұрын
Hi Tim, Thanks for the nice work. A quick question, Is it too late to pay for and start the weekly challenge ?? I think such challenge would improve my skills
@IAmTimCorey5 жыл бұрын
Nope, you can jump in at any time and you will get all of the previous challenges as well.
@zoltantoth47173 жыл бұрын
Hi Tim, eventually, why initializing _password = "" prevents Password property to be updated? Thank you for all your outstanding quality tutorials!
@IAmTimCorey3 жыл бұрын
I'm not sure what you mean. That line just initializes the string to have an empty string instead of a null.
@zoltantoth47173 жыл бұрын
@@IAmTimCorey Yes, but as you concluded if that initialization is done, the characters are not read into the Password property from the PasswordBox. I just don't get the reason why.
@mihaimyh5 жыл бұрын
Can you add a video to explain what is the best way to encrypt app.config file to hide the connection strings?
@IAmTimCorey5 жыл бұрын
It is on the list. However, I'm probably not going to encrypt the connection string. Instead, I'll probably talk through the ways to secure your data. Since the user has access to the machine running the connection string (if it is a desktop app), it does not matter how you encrypt it, the user will still have access to the unencrypted connection string. You cannot hide something through encryption if a person has access to one side of the encryption/decryption process.
@michaeleichner97974 жыл бұрын
Interesting video. In the long run playing around was very helpful. I am however confused by the following two questions: 1. Despite going through the Caliburn and Micro documentation, I couldn't figure out who or where the methods CanLogIn and LogIn were invoked. I had assumed they were part of an interface within Caliburn and Micro, but the code was able to build correctly even if I removed the implementation for those two methods which shouldn't happen if these methods were part of an interface. Are these two methods invoked by Caliburn and Micro and if so why does my code build without implementing these two methods? 2. Since the UserName property didn't have the problem that the Password property had and it was was able to invoke the method CanLogIn, why did we need to add the line: NotifyOfPropertyChange(() => CanLogIn) in the UserName property? Thanks
@IAmTimCorey4 жыл бұрын
The Login method gets invoked whenever the user hits the button because the button is named Login. The CanLogin is connected to the Login button because of naming convention ("Can"+the name of the button). It gets triggered whenever a property it relies on changes and we trigger the PropertyChanged event for it.
@dan_4 жыл бұрын
@@IAmTimCorey I didn't ask the question but thanks for following up on it! You missed their Q2, but from what I understand (as a beginner following your tutorials) I think you initially left that "NotifyOfPropertyChange(() => CanLogIn" on the UserName property by accident when playing around with ideas while debugging the Password issue. However, once you also decided to remove the parameters from the LogIn() function (since the password wasn't being passed through correctly anyway), that "NotifyOfPropertyChange(() => CanLogIn" statement actually became necessary since the chain was broken for Caliburn Micro to know which properties were related to LogIn/CanLogIn. One new question I now have though - I don't understand the reason for the "NotifyOfPropertyChange(() => UserName" and "NotifyOfPropertyChange(() => Password" statements, since the form appears to work fine without them and the LogIn button still enables/disables correctly as the fields update. The correct values are also passed through to the properties. Do they actually need to be there for something I've missed?
@puffinx73 жыл бұрын
In Absence of Bootstrapper in MvvmCross, is it still possible to recreate this shell view and subsequent Mode-within-a-model? I'm still trying to wrap my mind around the changes and the closest I see is App.cs in the Core project of my MvvM solution. I really like the shell concept so just trying to recreate it with the shiny new toys
@rafaeltab5 жыл бұрын
Jay new video :D
@IAmTimCorey5 жыл бұрын
Every Monday. I try to make the day a bit brighter.
@rafaeltab5 жыл бұрын
and you definitely do
@Waitaminutesilly5 жыл бұрын
Thanks for the video Tim, really nicely produced. Is Caliburn widely used in .Net shops? What was the reason for you to choose Caliburn API (sorry, if I have missed if you already explained in previous video)?
@IAmTimCorey5 жыл бұрын
Caliburn Micro has been around for years. It is consistently maintained and I've found it to be a good balance of opinionated and flexible. It is my personal preference for MVVM framework. There are a lot of shops that use it. At the end of the day, though, it is just one option and it stands in as a placeholder for any of the options. The other options will have slightly different syntax but the idea is the same.