Тёмный

WPF Login Form Creation - A TimCo Retail Manager Video 

IAmTimCorey
Подписаться 415 тыс.
Просмотров 72 тыс.
50% 1

** TimCo source code now at: www.iamtimcorey.com/courses/b...
Full Courses: www.iamtimcorey.com
Mailing List: signup.iamtimcorey.com/
Stack Overflow post: stackoverflow.com/questions/3...
One-off tutorials are awesome but they aren't the only thing you should be doing to learn C#. Another vital part of learning is learning how to put it all together. This interactive course is all about putting the pieces together. You can watch each video on its own or you can watch them in order and see a bigger picture. The choice is yours.
This course focuses on real-world development. As such, we are simulating that we work for TimCo Enterprise Solutions on a brand new product, the TimCo Retail Manager. Just like in the real world, we are starting out with one set of requirements but know that over time they will change.

Опубликовано:

 

2 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 458   
@TheDuerden
@TheDuerden 3 года назад
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!
@IAmTimCorey
@IAmTimCorey 3 года назад
I am glad they are pushing you to learn as we go. Way to stick with it.
@anwarsadatayub4740
@anwarsadatayub4740 4 года назад
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!
@IAmTimCorey
@IAmTimCorey 4 года назад
Thank you!
@williambell4591
@williambell4591 4 года назад
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...
@talkathiriify
@talkathiriify 5 лет назад
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
@IAmTimCorey
@IAmTimCorey 5 лет назад
You are most welcome. Thanks for watching.
@danish4129
@danish4129 3 года назад
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.
@IAmTimCorey
@IAmTimCorey 3 года назад
I am glad it was helpful. We all get stuck sometimes.
@officialspock
@officialspock 5 лет назад
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.
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.
@harryroper9659
@harryroper9659 5 лет назад
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
@jimlynch8313
@jimlynch8313 5 лет назад
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.
@IAmTimCorey
@IAmTimCorey 5 лет назад
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-deemon5813
@ua-deemon5813 3 года назад
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!
@IAmTimCorey
@IAmTimCorey 3 года назад
Absolutely! And thanks for the tips.
@vadymnarchuk9422
@vadymnarchuk9422 3 года назад
Fixed errors in names and everything works! I love this quest! Thanks a lot for the course!
@IAmTimCorey
@IAmTimCorey 3 года назад
You are welcome.
@desousamateus114
@desousamateus114 5 лет назад
"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!
@IAmTimCorey
@IAmTimCorey 5 лет назад
Thank you!
@johnhernandez2834
@johnhernandez2834 2 года назад
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 RU-vid videos and guide other young developers with your professional experience.
@IAmTimCorey
@IAmTimCorey 2 года назад
Glad it helped!
@tekneinINC
@tekneinINC 3 года назад
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!
@IAmTimCorey
@IAmTimCorey 3 года назад
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 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ZwxWCiW5uO4.html
@23myiah
@23myiah 5 лет назад
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
@IAmTimCorey
@IAmTimCorey 5 лет назад
You are welcome. Thanks for linking that.
@harag9
@harag9 5 лет назад
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!
@bedocan1
@bedocan1 5 лет назад
Hi Tim, it is again a great tutorial. And I like that you didn't remove debugging process. Thank you
@IAmTimCorey
@IAmTimCorey 5 лет назад
You are welcome.
@ben.thornhill
@ben.thornhill 5 лет назад
Great debugging wisdom Tim! Thanks another awesome video, I am really liking this series.
@IAmTimCorey
@IAmTimCorey 5 лет назад
You are welcome.
@rohanroy9818
@rohanroy9818 Год назад
Wow, this session was so much fun..... Thank you Tim...
@IAmTimCorey
@IAmTimCorey Год назад
Glad you enjoyed it!
@sc100200090
@sc100200090 4 года назад
Definitely Caliburn turned out to be great! Excellent buddy!
@IAmTimCorey
@IAmTimCorey 4 года назад
Thanks!
@harryperales
@harryperales 5 лет назад
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 :)
@IAmTimCorey
@IAmTimCorey 5 лет назад
Excellent!
@harag9
@harag9 5 лет назад
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.
@GabrielMariusPopescu
@GabrielMariusPopescu 2 года назад
Thank you Tim for this course... it's great!
@IAmTimCorey
@IAmTimCorey 2 года назад
You are welcome.
@nasben66
@nasben66 5 лет назад
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
@IAmTimCorey
@IAmTimCorey 5 лет назад
I will add it to the list. Thanks for the suggestion.
@milanmladenovic
@milanmladenovic 5 лет назад
Thank you Tim. Grate video as always.
@IAmTimCorey
@IAmTimCorey 5 лет назад
You are welcome.
@WaqasAli-ev7ge
@WaqasAli-ev7ge 5 лет назад
Thanks for the nice video. Waiting for the next video.
@IAmTimCorey
@IAmTimCorey 5 лет назад
Thank you!
@seanmcpadden1831
@seanmcpadden1831 Год назад
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.
@AntonyJudes
@AntonyJudes 5 лет назад
Thank you Tim. Interesting.
@IAmTimCorey
@IAmTimCorey 5 лет назад
You are welcome.
@talkathiriify
@talkathiriify 5 лет назад
Thank you very much Tom you are a wonderful
@IAmTimCorey
@IAmTimCorey 5 лет назад
You are welcome.
@perceptron4958
@perceptron4958 4 года назад
I found the same answer on s.o. After I couldn't solve the same problem myself I found this video. =)) Thx!
@IAmTimCorey
@IAmTimCorey 4 года назад
Awesome!
@V4MP_4EVA
@V4MP_4EVA 8 месяцев назад
Great videos it helped me a lot thanks
@IAmTimCorey
@IAmTimCorey 8 месяцев назад
You are welcome.
@Tielc
@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
@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
@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.
@aminebenhebba1891
@aminebenhebba1891 4 года назад
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).
@IAmTimCorey
@IAmTimCorey 4 года назад
In MVP, the view and the presenter are much more closely tied together. We don't really do MVP in WPF.
@andrewthompson9714
@andrewthompson9714 4 года назад
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.
@IAmTimCorey
@IAmTimCorey 4 года назад
Nice!
@alexn4217
@alexn4217 3 года назад
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!
@IAmTimCorey
@IAmTimCorey 3 года назад
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.
@alexn4217
@alexn4217 3 года назад
@@IAmTimCorey That's exactly what I did!
@dreamysap
@dreamysap 3 года назад
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.
@williambell4591
@williambell4591 4 года назад
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.
@IAmTimCorey
@IAmTimCorey 4 года назад
I'll look into it. Thanks for the suggestion.
@gordonhope9219
@gordonhope9219 3 года назад
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?
@krisculin9679
@krisculin9679 4 года назад
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?
@IAmTimCorey
@IAmTimCorey 4 года назад
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.
@alfonsdeda8912
@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.
@dkxc324e
@dkxc324e 3 года назад
good thanks
@IAmTimCorey
@IAmTimCorey 3 года назад
You are welcome.
@Campesguy
@Campesguy 2 года назад
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-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 2 года назад
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.
@babaniyiiyanu3425
@babaniyiiyanu3425 5 лет назад
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.
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.
@beautifulheartsoothingreci28
@beautifulheartsoothingreci28 3 года назад
Absolutely brilliant, thanks! I think "!String.IsNullOrWhiteSpace(UserName)" would probably even be a better check than "Username?." for form input like username :D
@IAmTimCorey
@IAmTimCorey 3 года назад
Interesting, thanks for sharing.
@dyachenkoserj
@dyachenkoserj 4 года назад
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?
@IAmTimCorey
@IAmTimCorey 4 года назад
That is Caliburn Micro wiring up the parameters by naming convention.
@jonestako4721
@jonestako4721 5 лет назад
thanks
@IAmTimCorey
@IAmTimCorey 5 лет назад
You are welcome.
@AkshayKumarTK
@AkshayKumarTK 4 года назад
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?
@IAmTimCorey
@IAmTimCorey 4 года назад
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.
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?
@IAmTimCorey
@IAmTimCorey 4 года назад
Yes, I think there is, but I don't have a code sample to point you to.
@harag9
@harag9 5 лет назад
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!
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.
@benli7348
@benli7348 2 года назад
userName/ password started with upper case, while they are lower case in viewmodel
@edikbaghdasaryan7656
@edikbaghdasaryan7656 5 лет назад
Thanks for such a significant content. Why not to use datatriggers for login button enabling instead of that whole staff in viewmodel?
@IAmTimCorey
@IAmTimCorey 5 лет назад
This is how Caliburn Micro and MVVM are configured. The code is in the ViewModel and separate from the view.
@maciej_s
@maciej_s 4 года назад
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!
@IAmTimCorey
@IAmTimCorey 4 года назад
That would definitely work. The issue is it doesn't leave room for easy expansion.
@puffinx7
@puffinx7 3 года назад
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
@TysonGibby
@TysonGibby 4 года назад
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.
@IAmTimCorey
@IAmTimCorey 4 года назад
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-
@TysonGibby
@TysonGibby 4 года назад
@@IAmTimCorey Thanks Tim!
@dionkllokoqi6981
@dionkllokoqi6981 3 года назад
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!
@IAmTimCorey
@IAmTimCorey 3 года назад
That is part of what Caliburn Micro provides us with. I believe I explain it more here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-laPFq3Fhs8k.html
@christopherkenn53
@christopherkenn53 3 года назад
@@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.
@Jason-Woolf
@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
@siddgoen
@siddgoen 3 года назад
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.
@mmushtaq908
@mmushtaq908 2 года назад
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.
@IAmTimCorey
@IAmTimCorey 2 года назад
That is a feature of Caliburn Micro (more info here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-laPFq3Fhs8k.html ). It uses naming conventions to match the validation check method to the button.
@Antonio-lt1sp
@Antonio-lt1sp 2 года назад
Excellent question, I was lost here as well.
@hans-ee
@hans-ee 4 года назад
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 "
@IAmTimCorey
@IAmTimCorey 4 года назад
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.
@rafaeltab
@rafaeltab 5 лет назад
Jay new video :D
@IAmTimCorey
@IAmTimCorey 5 лет назад
Every Monday. I try to make the day a bit brighter.
@rafaeltab
@rafaeltab 5 лет назад
and you definitely do
@vishalsaraganachari1604
@vishalsaraganachari1604 4 года назад
Great tutorial Tim I think, Interface(ILoginViewModel) would have been better in LoginViewModel constructor
@IAmTimCorey
@IAmTimCorey 4 года назад
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.
@giaccommander7474
@giaccommander7474 3 года назад
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
@IAmTimCorey
@IAmTimCorey 3 года назад
I'm glad it sucked you in.
@mcdls5
@mcdls5 3 года назад
@@IAmTimCorey That's what she said.
@daliangilbert
@daliangilbert 2 года назад
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 :-)
@shaswatsoni3228
@shaswatsoni3228 4 года назад
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)
@IAmTimCorey
@IAmTimCorey 4 года назад
Can you point to where the reflection is used (time code)? I don't remember using reflection.
@bobi9749
@bobi9749 5 лет назад
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?
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.)
@bobi9749
@bobi9749 5 лет назад
@@IAmTimCorey Thanks alot! You are the best
@linoyyarkoni6177
@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
@IAmTimCorey Год назад
Caliburn Micro is supported again. It wasn't for a while, but now it is back with a new, larger team of maintainers.
@geleffable
@geleffable 3 года назад
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.
@geleffable
@geleffable 3 года назад
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.
@christopherkenn53
@christopherkenn53 3 года назад
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?
@IAmTimCorey
@IAmTimCorey 3 года назад
The git tools in Visual Studio have been radically changing over the past year. We will be going over them soon.
@SaveTheHedgehog
@SaveTheHedgehog 4 года назад
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?
@IAmTimCorey
@IAmTimCorey 4 года назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-laPFq3Fhs8k.html
@Waitaminutesilly
@Waitaminutesilly 5 лет назад
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)?
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.
@Waitaminutesilly
@Waitaminutesilly 5 лет назад
@@IAmTimCorey Thanks!
@donybg
@donybg 5 лет назад
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!
@IAmTimCorey
@IAmTimCorey 5 лет назад
It is something I've considered. I would want to do it well though. Still working through how to do it.
@aaronpaul2550
@aaronpaul2550 27 дней назад
I love you
@IAmTimCorey
@IAmTimCorey 27 дней назад
Thanks!
@karatekid559
@karatekid559 5 лет назад
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?
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.
@cqli7981
@cqli7981 4 года назад
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
@cqli7981
@cqli7981 4 года назад
I see, I saw the answer below.
@IAmTimCorey
@IAmTimCorey 4 года назад
Great!
@kkarol1983
@kkarol1983 3 года назад
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.
@IAmTimCorey
@IAmTimCorey 3 года назад
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.
@kkarol1983
@kkarol1983 3 года назад
​@@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.
@onyebuchiboss
@onyebuchiboss 5 лет назад
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
@IAmTimCorey
@IAmTimCorey 5 лет назад
Nope, you can jump in at any time and you will get all of the previous challenges as well.
@Prim3MavericK
@Prim3MavericK 3 года назад
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.
@IAmTimCorey
@IAmTimCorey 3 года назад
Ah, that will do it. I am glad you figured it out.
@dsollock
@dsollock 2 года назад
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.
@dsollock
@dsollock 2 года назад
I did not have the LoginViewModel class set to public. Thank you for your lessons.
@dumdahdum
@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
@IAmTimCorey Год назад
Thanks for sharing.
@berkerozgur6517
@berkerozgur6517 Год назад
I am using v4 and async but it works for me. Will it be a problem in the future?
@joannagechanfon4770
@joannagechanfon4770 6 месяцев назад
@@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
@petrhavlat5159
@petrhavlat5159 2 месяца назад
@@joannagechanfon4770 remove typeof operator.. await DisplayRootViewForAsync(); this works for me
@johnschut5776
@johnschut5776 4 года назад
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?
@IAmTimCorey
@IAmTimCorey 4 года назад
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.
@zoltantoth4717
@zoltantoth4717 3 года назад
Hi Tim, eventually, why initializing _password = "" prevents Password property to be updated? Thank you for all your outstanding quality tutorials!
@IAmTimCorey
@IAmTimCorey 3 года назад
I'm not sure what you mean. That line just initializes the string to have an empty string instead of a null.
@zoltantoth4717
@zoltantoth4717 3 года назад
@@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.
@karatekid559
@karatekid559 4 года назад
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
@IAmTimCorey
@IAmTimCorey 4 года назад
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.
@brewandrew
@brewandrew 3 года назад
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!
@IAmTimCorey
@IAmTimCorey 3 года назад
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.
@frankcui9951
@frankcui9951 4 года назад
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?
@IAmTimCorey
@IAmTimCorey 4 года назад
I would suggest you learn about the things you are seeing that confuse you before you move on.
@muhammadfarooqchaudhry9070
@muhammadfarooqchaudhry9070 2 года назад
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?
@IAmTimCorey
@IAmTimCorey 2 года назад
My suggestion is to find the bug. Avoiding bugs by going around them isn't a great idea. That will catch up to you.
@roycelithgo3968
@roycelithgo3968 5 лет назад
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. :)
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.
@hollowlife1987
@hollowlife1987 4 года назад
@@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.
@martin8660
@martin8660 4 года назад
Hey Tim. In my application, i have the contentcontrol fill the entire ShellView, and i made it successfully load in the LoginView like your example. How would i go about navigating to a SignUpView with a button that is on the LoginView? I want to avoid the menu as it wouldn't make sense in my application.
@IAmTimCorey
@IAmTimCorey 4 года назад
Have it broadcast an event that the ShellViewModel listens for that tells ShellViewModel to switch to the SignUpView.
@EndeXlol
@EndeXlol 2 года назад
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?)'
@IAmTimCorey
@IAmTimCorey 2 года назад
Did you add the Caliburn Micro NuGet package? Is it the same version that I added?
@nowaybtch
@nowaybtch 4 года назад
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?
@IAmTimCorey
@IAmTimCorey 4 года назад
If Username or Password is null, the != will crash the application because you can't get a property off of a null value.
@AthensDotNet
@AthensDotNet 5 лет назад
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.
@IAmTimCorey
@IAmTimCorey 5 лет назад
Must have been a small difference somewhere.
@harryperales
@harryperales 5 лет назад
double check on your casings, most likely your not using the proper casing and caliburn micro cant figure out the binding
@PelFox
@PelFox 5 лет назад
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);
@IAmTimCorey
@IAmTimCorey 5 лет назад
Yep, that will work.
@michaeleichner9797
@michaeleichner9797 4 года назад
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
@IAmTimCorey
@IAmTimCorey 4 года назад
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_
@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?
@juliusjoemarmartin6096
@juliusjoemarmartin6096 3 года назад
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.
@juliusjoemarmartin6096
@juliusjoemarmartin6096 3 года назад
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.
@tonyfarlie3903
@tonyfarlie3903 3 года назад
@@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.
@bobi9749
@bobi9749 5 лет назад
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?
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.
@_Szakal
@_Szakal 4 года назад
why in ViewModelShell in ctor you put LoginViewModel instead insterface like ILoginViewModel ? It should be interface for better testability instead that concrete class.
@IAmTimCorey
@IAmTimCorey 4 года назад
I used the VM because I haven't set this up for testing. Yes, for testing, it would be better to use the interfaces.
@shane.saunders
@shane.saunders 5 лет назад
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?
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.saunders
@shane.saunders 5 лет назад
@@IAmTimCorey I understand what you are talking about. Thank you
@zacharywatson6799
@zacharywatson6799 5 лет назад
How would you open up that LoginView from the ShellViewModel in a separate window?
@IAmTimCorey
@IAmTimCorey 5 лет назад
This should help: claytonone.wordpress.com/2015/01/16/caliburn-micro-part-6-the-window-manager/
@mihaimyh
@mihaimyh 5 лет назад
Can you add a video to explain what is the best way to encrypt app.config file to hide the connection strings?
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.
@NickGerritz
@NickGerritz 5 лет назад
Hi Tim, thanks for the awesome series! Tim iv followed through every video and have a working proj so far, except for this specific video, where I have fixed the password issue to now have a value, but in debug mode i can see that my UserName field is never read and is never NULL then so my login button fails. my break-point on NotifyOfPropertyChange-Username never catches a user name change on its break-point proving no value is being read from the UserName Field... The Password one works fine and looking at the code, both the UserName and The Password is practically identical in structure. What can cause the Username field not to notify on change(and also not change from Null to its field value) while the Password field is read and works? I think the Username field stopped being read when I introduced that StackOverflow code for the PwdBoxhelper and the bootstrapper - although that does still make password work, except i cant proceed now since username && password check fails since one remains empty/null? Any ideas? i can send u my LoginViewModel.cs file if you want, maybe u can spot an obvious mistake? - thanks again for the great series, when im a little richer than "Flat Broke", ill be sure to send you some treasure - YOU ROCK!
@IAmTimCorey
@IAmTimCorey 5 лет назад
My guess is that you have a spelling error. Check the textbox's name and make sure it is identical to the property name. My guess is that one of them has a typo. That will cause the field not to bind.
@NickGerritz
@NickGerritz 5 лет назад
@@IAmTimCorey Hey Tim thanks for the tip, so I went hunting for spelling mistakes and found only 1 problem, although it was NOT misspelled, it was incorrectly Cased in the LoginView.xaml file where i had UserName's instead of
@PelFox
@PelFox 5 лет назад
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.
@IAmTimCorey
@IAmTimCorey 5 лет назад
Yeah, that is confusing.
@TheMessixaviniesta
@TheMessixaviniesta 4 года назад
I think this one of the few things where CSS makes sense.
@mohamaddjelouah9332
@mohamaddjelouah9332 5 лет назад
hi tim i want to ask you a question can we use mvvm with material design and is there any problems ??
@IAmTimCorey
@IAmTimCorey 5 лет назад
That is on the suggestion list. We will see.
@danielpatfield4779
@danielpatfield4779 4 года назад
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!
@danielpatfield4779
@danielpatfield4779 4 года назад
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.
@IAmTimCorey
@IAmTimCorey 4 года назад
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.
@danielpatfield4779
@danielpatfield4779 4 года назад
@@IAmTimCorey Thanks. That's what I figured. Do you have any courses out there that focus on binding and accomplishing these things without CM? ;-)
@alexaprodu5346
@alexaprodu5346 4 года назад
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.
@danielpatfield4779
@danielpatfield4779 4 года назад
Hey Tim: I've tried to figure out how to get the grid lines out of the grid AND the forms. I went to TOOLS:OPTIONS - and set show grid to false, but that does not seem to work. How can I get my form to look like yours. I have the white background, but again, the actual form and grid has the lines. I'm using VS 2019, and that's how it looked when I created the View(s). I didn't see you go to any properties to remove grid lines, so I assume it's already the default for you (in an earlier version)? Any ideas?
@IAmTimCorey
@IAmTimCorey 4 года назад
I believe you are talking about the design lines that show up as you are working but aren't there when you run the app. Those lines are based upon where your cursor is in the XAML. Put your cursor right inside the last tag on the page and they should go away.
@danielpatfield4779
@danielpatfield4779 4 года назад
@@IAmTimCorey Thanks for the tip, but the grid lines are like a perm fixture in my design view(s). I placed the cursor at the lat tag of the xaml and the lines are still there. No biggie. I'm sure I'll figure it out soon enough!
@mahfoudbouabdallah6286
@mahfoudbouabdallah6286 4 года назад
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.
@IAmTimCorey
@IAmTimCorey 4 года назад
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.
@kemmrich
@kemmrich 5 лет назад
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?
@IAmTimCorey
@IAmTimCorey 5 лет назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-laPFq3Fhs8k.html
@kemmrich
@kemmrich 5 лет назад
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?
@timothywestern6488
@timothywestern6488 5 лет назад
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.
@timothywestern6488
@timothywestern6488 5 лет назад
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.
@desousamateus114
@desousamateus114 5 лет назад
Tip: When duplicating lines, you can do "Ctrl+D" it will duplicate the line, instead of doing "Ctrl+C" + "Ctrl+V".
@IAmTimCorey
@IAmTimCorey 5 лет назад
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.
@desousamateus114
@desousamateus114 5 лет назад
@@IAmTimCorey Funny, I recently downloaded VS19, havent downloaded any kind of extension.
@desousamateus114
@desousamateus114 5 лет назад
@@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/
@BristlyBright
@BristlyBright 4 года назад
@@desousamateus114 Nice! Thanks for the tips! Very helpful.
Далее
▼ЧЁРНАЯ МАГИЯ 🔮
31:15
Просмотров 502 тыс.
Getting User Data - A TimCo Retail Manager Video
1:13:38
WPF Controls with MVVM: DataGrid
24:59
Просмотров 171 тыс.
Binding to a PasswordBox (MVVM) - EASY WPF (.NET CORE)
12:14
▼ЧЁРНАЯ МАГИЯ 🔮
31:15
Просмотров 502 тыс.