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...
@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!
@tekneinINC4 жыл бұрын
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!
@IAmTimCorey4 жыл бұрын
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
@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.
@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.
@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.
@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.
@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.
@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!
@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!
@Jason-Woolf2 жыл бұрын
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
@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.
@Tielc2 жыл бұрын
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.
@IAmTimCorey2 жыл бұрын
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.
@Tielc2 жыл бұрын
@@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.
@Campesguy3 жыл бұрын
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-iamtimcorey75973 жыл бұрын
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!
@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.
@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.
@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
@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 :-)
@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.
@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.
@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 :-)
@joannagechanfon4770 Жыл бұрын
@@IAmTimCorey Thanks god I found this suggestion because I spend more than 3 hours trying to fix it
@bhuriwataunguranun637111 ай бұрын
@@IAmTimCorey I've tried to downgrade version of Caliburn.Micro from 4.xx to 3.xx but it doesn't work.
@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.
@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?
@joannagechanfon4770 Жыл бұрын
@@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
@petrhavlat51598 ай бұрын
@@joannagechanfon4770 remove typeof operator.. await DisplayRootViewForAsync(); this works for me
@faraz-online4 жыл бұрын
Definitely Caliburn turned out to be great! Excellent buddy!
@IAmTimCorey4 жыл бұрын
Thanks!
@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?
@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.
@ericjurotich90785 жыл бұрын
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.
@ericjurotich90785 жыл бұрын
Nm, I figured it out. I had typed instead of the correct code which is in ShellView. It works now!
@IAmTimCorey5 жыл бұрын
Yep, those little details will get you.
@FenelHyacinthe5 жыл бұрын
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
@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.
@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
@ben.thornhill5 жыл бұрын
Great debugging wisdom Tim! Thanks another awesome video, I am really liking this series.
@IAmTimCorey5 жыл бұрын
You are welcome.
@brewandrew4 жыл бұрын
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!
@IAmTimCorey4 жыл бұрын
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.
@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!
@alfonsdeda89122 жыл бұрын
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.
@davidbatista25513 жыл бұрын
Hi Tim my ActivateItem method is not working is it obsolete?
@IAmTimCorey3 жыл бұрын
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.
@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.
@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?
@ravimohan61442 жыл бұрын
Great course! But I am stuck at constructor injection(29:29). I am getting a compiler error: CS0051, which states that to make sure the types used in the method signatures are not accidentally private. Which is exactly what we are doing here. I am using VS2022. Anyone here have tried this project with VS2022? Or do I have any other solution. I am 3/10 in CSharp and looking to reach at least to 5/10 by doing course to the letter and spirit. Need help...
@ravimohan61442 жыл бұрын
I think I figured out the above issue. The problem was the LoginViewModel class was created as internal class by default and had to make it a public class. But now I have a different issue. Though I have done the constructor injection with the LoginViewModel object, I don't see the LoginView userControl loading into the ShellView.
@jabulanimashia6778 Жыл бұрын
@@ravimohan6144 thank you
@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!
@perceptron49585 жыл бұрын
I found the same answer on s.o. After I couldn't solve the same problem myself I found this video. =)) Thx!
@IAmTimCorey5 жыл бұрын
Awesome!
@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.
@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!
@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.
@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.
@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?
@linoyyarkoni61772 жыл бұрын
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?
@IAmTimCorey2 жыл бұрын
Caliburn Micro is supported again. It wasn't for a while, but now it is back with a new, larger team of maintainers.
@GabrielMariusPopescu3 жыл бұрын
Thank you Tim for this course... it's great!
@IAmTimCorey3 жыл бұрын
You are welcome.
@karatekid5595 жыл бұрын
Hello Tim and anyone else who can help. I have a few quick questions. At the 38:40 min mark you have a lowercase userName parameter in the CanLogIn() method and then check its Length in an if statement inside of the method itself. How does it know to match the lowercase userName parameter to the uppercase UserName property. Is it just because they're spelled the same, and if so is that something that's coming from Caliburn.micro or is that just a regular c# thing I didn't know about? Also does the UserName property automatically link up with the UserName textbox due to spelling and also casing? Finally we implement the Screen interface, is this what allows NotifyOfPropertyChange? Thanks in advance for any response
@IAmTimCorey5 жыл бұрын
Yes, Caliburn Micro handles those translations of casing and it matches up the property to the named item on the form. And yes, Screen is what allows us to use NotifyOfPropertyChange. My WPF with MVVM video covers some of the basics of Caliburn Micro. That might help clarify some things.
@desousamateus1145 жыл бұрын
Tim, at 52:30 you put a get{} but when I do it on vs19 .net 4.7.2 it says that "The name 'get' doesnt exist in the current context"
@IAmTimCorey5 жыл бұрын
It sounds like you have a syntax error. The get is part of a property. Make sure you are using curly braces, not parenthesis.
@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.
@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!
@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.
@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.
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.
@puffinx74 жыл бұрын
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
@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.
@westblueconsulting46025 жыл бұрын
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
@IAmTimCorey5 жыл бұрын
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.
@EX1L3D_L3G3ND5 жыл бұрын
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?
@IAmTimCorey5 жыл бұрын
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.
@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.
@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.
@cqli79814 жыл бұрын
Hi, Tim, Thanks again for this excellent video. I have maybe a stupid question: how the "LogIn" button "enable" property was linked with CanLogIn property? I could not find it either in the ShellViewModel.cs file, nor the ShellView.xaml file. thanks and regards
@cqli79814 жыл бұрын
I see, I saw the answer below.
@IAmTimCorey4 жыл бұрын
Great!
@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
@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.
@dalewolver87394 жыл бұрын
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?
@IAmTimCorey4 жыл бұрын
This is something Caliburn Micro does for us. I explain it a lot more in this video: kzbin.info/www/bejne/opKzd6Rpe82mbs0
@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.
@maciej_s5 жыл бұрын
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!
@IAmTimCorey5 жыл бұрын
That would definitely work. The issue is it doesn't leave room for easy expansion.
@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.
@roycelithgo39685 жыл бұрын
Hi Tim. Any reason why you don't use the Toggle artboard button on the preview toolbar (3rd button from white) instead of setting white background colour? The nice thing about this is it applies to all previews, so you don't need to change code as you do with white background. It's something i've noticed in all your WPF videos. :)
@IAmTimCorey5 жыл бұрын
It is a preference thing. It is probably something I should bring up at some point just to show the alternatives. I just prefer the dark background around the form. The artboard toggle makes everything white (the background of the form and around the form.
@hollowlife19874 жыл бұрын
@@IAmTimCorey Something I prefer to do is set the White background in design mode only using a design mode only style ` .... ` Neat thing about this is if you explicitly set a background color for run time it overrules the design time in the preview window in addition to only applying the style to the preview window.
@frankcui99514 жыл бұрын
Hi Tim Whats your suggestion to learn the language? Do I pause and read about things like DockPanel and Menu(I don't know what they do) or just keep going, get through all the videos and come back to them?
@IAmTimCorey4 жыл бұрын
I would suggest you learn about the things you are seeing that confuse you before you move on.
@Prim3MavericK4 жыл бұрын
Hi, at 29:11 you use "ActivateItem" but when I do it, VS doesn't recognize it
@Prim3MavericK4 жыл бұрын
SOLVED: If it doesn't appear, downgrade Caliburn version to v3.2
@IAmTimCorey4 жыл бұрын
I am glad you figured it out. We will use Caliburn Micro 4 when we upgrade to .NET Core. The ActivateItem becomes ActivateItemAsync.
@zoltantoth47174 жыл бұрын
Hi Tim, eventually, why initializing _password = "" prevents Password property to be updated? Thank you for all your outstanding quality tutorials!
@IAmTimCorey4 жыл бұрын
I'm not sure what you mean. That line just initializes the string to have an empty string instead of a null.
@zoltantoth47174 жыл бұрын
@@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.
@christopherkenn533 жыл бұрын
What version of VS and Git are you using in your videos? I have VS 2019 community. The Git/Team Explorer are way different (and in my opinion much harder to follow/use). Can you point me to somewhere so I can learn the whole Git interactions you show and what has to be done with what is obviously newer versions (what I would call the "master/main" changes?
@IAmTimCorey3 жыл бұрын
The git tools in Visual Studio have been radically changing over the past year. We will be going over them soon.
@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?
@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.
@milanmladenovic5 жыл бұрын
Thank you Tim. Grate video as always.
@IAmTimCorey5 жыл бұрын
You are welcome.
@rayt68675 жыл бұрын
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.
@IAmTimCorey5 жыл бұрын
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
@rayt68675 жыл бұрын
@@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.
@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.
@geleffable3 жыл бұрын
First, thank you for these videos they are great. I have a question. Im getting a syntax error 'name does not exsist in the current context'. When using NotifyOfPropertyChange, Ive tried updating, restarting, deleting the project and restarting from scratch. I feel like im missing something obvious.
@geleffable3 жыл бұрын
SO the problem fixed itself, I had tried with implementing a IExceptionhandler method, it sorta worked but now that fix is redundant due to Notify... working.
@bobi97495 жыл бұрын
Should big Enterprise Applications use MVVM Frameworks like Caliburn or MVVMLight or rather implement MVVM themselves? At my workplace its all without frameworks, its alot more work but is it the way to go?
@IAmTimCorey5 жыл бұрын
I replied to you yesterday but something must have happened to the comment. I get what companies are thinking: anything they depend on that can go away could leave them vulnerable. So you spend the time and make your own MVVM implementation so that you control the entire system and aren't dependent on anyone. However, with open source the game changes. If you depend on CM and they go away, you fork the repo and maintain it from there. So you end up in the same spot as if you rolled your own except you didn't invest all the time to get to where CM left off (if they were to leave). That's the worst case. The best case is that you don't have to maintain or update your MVVM system and someone works for you for free (a really good argument for companies to contribute financially to open source maintainers). The other benefit you get from using something like CM is you get to build on the shoulders of giants. They have spent years making the system better. They have gone through a lot of hard work to get to where they are today. You get to take advantage of all of that. Or, you could roll your own and go through the same or similar issues over the course of years to finally get to where they were when you started. Seems like an obvious choice to me, but every company has their own situation and circumstances that they need to work through.
@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.
@Waitaminutesilly5 жыл бұрын
@@IAmTimCorey Thanks!
@frankcui93223 жыл бұрын
do we need to learn more about caliburn micro to understand what is going on, or should we just move along accepting some of the magic that is happening?
@IAmTimCorey3 жыл бұрын
I prefer not having magic in my coding, so I would recommend watching this video to get up to speed: kzbin.info/www/bejne/opKzd6Rpe82mbs0
@ferb11312 жыл бұрын
@@IAmTimCorey But this video was all about magic. Magic 'CanLogIn' functions that affected the state of buttons we hadn't wired them up to using properties we weren't using to call those functions (indeed, we weren't calling the functions from anywhere in the code, but they were somehow magically called anyway), so when they weren't called they were hard to debug because magic causes problems when it stops working, exactly like it stopped working in this video... If you don't like magic in your coding you have a strange way of showing it, because everything in the second half of this video was magic-based!
@shakrazj3 жыл бұрын
I loved this tutorial, but I am using Stylet, and this all fell apart when I couldn't pass parameters to my LogIn method, because the protected override void Launch() method in Stylets bootstrapper would not allow it. How could I work around that? Also, will being a patreon (or any other sort of subscription) give you the right to any sort of personal follow up/chance of getting help with projects?
@IAmTimCorey3 жыл бұрын
I don't have an answer for you because I've not used Stylet. As for the benefits of Patron membership, no, I don't offer personal help or assistance. With an audience in the hundreds of thousands, I simply do not have the time to do something like that.
@shakrazj3 жыл бұрын
@@IAmTimCorey Fair enough!
@shane.saunders5 жыл бұрын
Hello, Tim I have been going through your online courses. They are good, I have been VB.net programmer and i want to understand C# better and how to use WPF and MVVM. I read through the stackoverflow post and the first person, made the CanLogIn a property and did NotifyOfPropertyChanged. I changed your code just little instead of using Username?.Length > 0, I just used !string.IsNullorEmpty(UserName) and same for Password, which thinking now, i could just did as one return line. Does that do give the same results you were trying get if use !string.IsNullorEmpty or something completely different?
@IAmTimCorey5 жыл бұрын
Yes, your code is functionally equivalent to mine. The only difference is that I can change mine to have a different character count than zero. So, I could change it tomorrow to say > 2. To do the same with your code, you would need to make more extensive changes. I like putting things in place that will be easy to mildly change later without major changes (as long as it doesn't compromise the code today).
@shane.saunders5 жыл бұрын
@@IAmTimCorey I understand what you are talking about. Thank you
@dsollock3 жыл бұрын
Hello and thank you for your course. When I add the LoginViewModel param to the ShellViewModel constructor I get a CS0051 error (Inconsistent accessibility: param type 'type' is less accessible than method 'method'. I may have missed something. I reviewed my code and compared to yours so far with no luck. Any idea of what I may have missed.
@dsollock3 жыл бұрын
I did not have the LoginViewModel class set to public. Thank you for your lessons.
@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!
@karatekid5595 жыл бұрын
Hello Tim I have a quick question. I'm trying to implement something similar to a UWP NavigationView in my app so I was thinking of putting the hamburger menu on my ShellView, but then I realized that it would be visible during the Log In Page which doesn't really make sense. Would you recommend having a Grandparent->Parent->Child situation where after I log in I load the "NavigationView" page that has an additional view in it?
@IAmTimCorey5 жыл бұрын
Couple things you could do. One, you could create the login page as a full page and set that as the opening page. Then load the parent/child page after log in. Or, you could hide the menu if a user is not logged in.
@zacharywatson67995 жыл бұрын
How would you open up that LoginView from the ShellViewModel in a separate window?
@IAmTimCorey5 жыл бұрын
This should help: claytonone.wordpress.com/2015/01/16/caliburn-micro-part-6-the-window-manager/
@johnschut57764 жыл бұрын
Hi Tim, I'm having red squigllies under ''BoundPasswordProperty throughout the code from you had copied from Stack Overflow. I have looked through the code for a possible casing issue but even after taking several breaks, I'm still missing this tree from the forest. Although some of this seems a wee 'bit of magic, I'm figuring its from a property called Password? any clues as to where I look for mysterious termite?
@IAmTimCorey4 жыл бұрын
Those red squiggles have an error message as part of them. Maybe those error messages will help you. It sounds like you are missing a using statement or a reference.
@kkarol19834 жыл бұрын
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.
@IAmTimCorey4 жыл бұрын
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.
@kkarol19834 жыл бұрын
@@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.
@mohamaddjelouah93325 жыл бұрын
hi tim i want to ask you a question can we use mvvm with material design and is there any problems ??
@IAmTimCorey5 жыл бұрын
That is on the suggestion list. We will see.
@WaqasAli-ev7ge5 жыл бұрын
Thanks for the nice video. Waiting for the next video.
@IAmTimCorey5 жыл бұрын
Thank you!
@adamschneider8684 жыл бұрын
Is there a reason for not just using the ToolBox and Dragging and Dropping your elements onto the form? Does it not work so well? Just wondering
@Brickscrap4 жыл бұрын
If you drag things in from the toolbox in WPF, their positions and sizes become absolute, and the XAML becomes a mess. It goes against the whole idea behind WPF - flexibility. If you look at a WinForms app which works with drag and drop, it's all hard-coded fixed sizes and positions. In WPF you can dynamically resize and everything moves around and resizes as required
@adamschneider8684 жыл бұрын
@@Brickscrap awesome thanks.
@IAmTimCorey4 жыл бұрын
Gary is correct. Thanks Gary.
@christopherkenn533 жыл бұрын
@@IAmTimCorey Isn't there VS settings to turn positioning and sizing absolute off when drag-n-drop from toolbox?
@muhammadfarooqchaudhry90703 жыл бұрын
Hi Tim, Your course is so good. I'm following it but I got a problem. My login usercontrol is not showing in ShellView and I'm not getting any error as well? any other way I can use login form?
@IAmTimCorey3 жыл бұрын
My suggestion is to find the bug. Avoiding bugs by going around them isn't a great idea. That will catch up to you.
@nowaybtch4 жыл бұрын
I have seen every video and you're really good at explaining. I will probably do exactly as you do but.. In the end after you troubleshooted and found out you could use the ? in userName?.Length > 0 && password?.Length > 0 i tried to take the ? away and instead of using the > 0 i changed to this code: if (UserName.Length != 0 && Password.Length != 0) When debugging and testing it out it work the same way.. Would writing != instead of using the Username?.Length be any different and cause problems later in code?
@IAmTimCorey4 жыл бұрын
If Username or Password is null, the != will crash the application because you can't get a property off of a null value.
@juliusjoemarmartin60963 жыл бұрын
Hi Tim, first your videos are great and awesome. I'm following this project of yours and I have question, I follow this video all through out but every time I run my application my "LogIn" button seems to be enabled in default. What seems to be problem?. Sorry for my question, I don't have enough knowledge in WPF. Thank you.
@juliusjoemarmartin60963 жыл бұрын
I added this inside my button *IsEnabled="{Binding CanLogIn}"* and actually works , however I cant seem to see this on this video. And I wanted how you do things. Please let me know if there is something I forgot or what not. Thank you.
@tonyfarlie39033 жыл бұрын
@@juliusjoemarmartin6096 When he changed the button name from "LoginButton" to "LogIn" did you capitalise the "i"? I made the mistake of just deleting the word "Button" from the name (i.e. "Login"). if the name doesn't match up with the "CanLogIn" and "LogIn" methods in LoginViewModel then Calibrun.Micro won't be able to wire them up together.
@benli73483 жыл бұрын
userName/ password started with upper case, while they are lower case in viewmodel