One of the things I really love about Tim's tutorials are all the little side things that are common place in the real world but often missed in tutorials. Like how to write a commit message, little things like this are never taught but always needed and it's great to see examples in tutorials. Keep up the great work.
@IAmTimCorey4 жыл бұрын
I'm glad you are enjoying the videos (and the extras).
@Korodak5 жыл бұрын
Great tutorial. I'm learning C# and i like WPF and your channel is one of the best which I found in KZbin. High quality, good teacher. Keep going!
@IAmTimCorey5 жыл бұрын
Thank you!
@99MrX995 жыл бұрын
I would suggest using an int instead of a string for the Quantity, that will also have the nice effect that any input that can not be converted to int will cause the TextBox to be highlighted in red and no TryParse is needed in the ViewModel. Do you know that you can call NotifyOfPropertyChange without a parameter inside the property? Because it uses CallerMemberName it get's the name of the property it was called in automatically. And there is an even shorter way to set the property and notifying. You could use the method Set(ref oldvalue, newvalue) form Caliburn.Micro in the setter. When combined together with the expression body setters the clutter needed to set the property is again reduced, which makes it much clearer. That would for example look like this: public int ItemQuantity { get => _itemQuantity; set => Set(ref _itemQuantity, value); }
@antoneriksson2085 жыл бұрын
As i myself has been playing around with xamarin.forms and prism (which have a very similar method for viewmodels: "SetProperty()") it is really great to see that caliburn.micro has this method aswell!
@IAmTimCorey5 жыл бұрын
I thought that was the case but I wasn't certain (and didn't take the time to test it before recording). Thanks a ton for pointing it out. I'll add changing the type to int to the "to fix" list. I really appreciate it. As for the Set function, I like the idea of it but I'm not convinced of the benefit yet (I appreciate you pointing it out though). It is one more thing to remember and it obfuscates what is going on behind the scenes. The problem for me is consistency and transparency. If some methods have NoPC and others don't, that can be confusing. I'm going to think about it. The keys for me are "Is it easily readable/understandable?", "Is it clear?", and "Is it simple?". It is simpler and readable but I get stuck on understandable and clear. I'm just not sure yet.
@harag95 жыл бұрын
Great episode Tim, thanks for this, much appreciated. Never done WPF before (being a winforms developer) so it's still something new to me.
@IAmTimCorey5 жыл бұрын
Thanks!
@HollandHiking4 жыл бұрын
Thanks a lot for this video. I am still wrestling a lot with MVVM and Caliburn.Micro specifically to get it working. Coming closer now... One WPF comment: I use only vertically, for horizontal stackpanels you can use , which will flow to the netx "line" if there is not any more space. Not sure if the StackPanel does this. I use not always as the basic panel layout. Normally, I start using a , which keeps the solution at least workable on small screens. Inside that I Use a StackPanel and then you can easily stak a number of smaller grids. Also, I try to put all markup in separated styles, a topic you did not yet address. The advantage is, that it makes it much easier to change the look and feel, and keep stuff consistent over your solution. It is not a trivial task designing your styles for this purpose . I think it may be worth an article for CodeProject, as soon as I have some time to do so. More generally, I would love to see a more in depth course explaing for Caliburn.Micro not only how to use it, but also how it works internally. The reason is, that it still feels a lot like magic to me, and I do not like magic ...
@IAmTimCorey4 жыл бұрын
StackPanel does not wrap content, which can be a benefit since wrapped content can mess things up (everything gets pushed down) so it depends on your use case which you use. Thanks for the suggestion on CM in depth. I'll add it to the list.
@DXvega4 жыл бұрын
UserControl xaml tip: Delete d:DesignWidth / Height and view will size to content. Thanks for the video!
@IAmTimCorey4 жыл бұрын
Thanks for sharing!
@elchureee4 жыл бұрын
Hi! A tutorial about using tabs for multiple user controls using Caliburn micro would be great!
@IAmTimCorey4 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@tinumurymury385 жыл бұрын
Hi Tim, Isn't the NotifyOfPropertyChange in the ItemQuantity property suppose to be from ItemQuantity instead of Products?
@IAmTimCorey5 жыл бұрын
Yep, that's a copy/paste bug that I missed. Thanks for pointing it out. I'll correct it soon.
@321zipzapzoom4 жыл бұрын
Grt tutorial Mr.Corey again..Just one quick ques,Suppose if we wanna put a check on Itemquantity max value ..
@IAmTimCorey4 жыл бұрын
To limit what goes into the cart? You could do that if you want.
@rodrigo64595 жыл бұрын
Tim.. another JEWEL for your channel! thanks!, i need to ask a question related to Git, why stage when you can just do the check out?, looks like an unnecessary extra step... Thank you!
@IAmTimCorey5 жыл бұрын
The way git works is that you stage, then commit, then push. The reason for the stage is so that you can separate out change sets. You can stage part of your changes instead of all of them at once. There isn't a concept of check out. That's more a concept of a centralized version control, where you check out an item and hold exclusive access to it until your changes are done. In git, anyone can work on the same file at the same time.
@obigbaebruski50663 жыл бұрын
Wow... Good Day @IAmTimCorey thanks for your courses here on KZbin. You have helped many and more. I am a fan of EF I have read about Dapper but really haven't used it before. As at following this course I used it for the first time and observed that we have two databases one for Identity and one for our application. 1. can we link dapper with Identity to automatically create those Identity tables and the equivalent stored procedures for us? 2. is there a way you can set it for the application to automatically check to see if the database exist? if not it should publish that sql and create the database and stored procedures automatically.
@ProjectNotFinished5 жыл бұрын
Hi Tim, Interested in your use of WPF TextBlocks rather than Labels in the XAML pages. My understanding was that we use Labels where there is a logical connection to the target field (the word "Password" next to the Password field) and TextBlocks for stand alone text. Is there any upside or downside with either approach? stackoverflow.com/questions/5382925/difference-between-label-and-textblock
@IAmTimCorey5 жыл бұрын
The main reason I primarily use TextBlocks for data is the last statement in the selected answer: Labels are much heavier. They can do a lot but I don't usually need that power so I don't make them labels. That makes my app lighter and faster.
@ProjectNotFinished5 жыл бұрын
@@IAmTimCorey Thanks Tim. I will bear that in mind when selecting controls
@Musa1978K4 жыл бұрын
another amazing tutorial thank you
@IAmTimCorey4 жыл бұрын
You're very welcome!
@kemmrich5 жыл бұрын
1.) VS 2019 Community 16.0.1 allows you to see the screen size to 80% manually. They must have fixed that. 2.) In previous WPF videos you added a margin of 10 to the 0 column and the 0 row to add a "border" to each xaml screen. That way the first active row would be row 1 and the first active column would be column 1. You are not doing this for the TRM project. Is there an overriding reason for that? (Edit: It seems we are setting default margins in the ShellView.xaml file) 3.) I just can't get VS 2019 to open with the "Start Window" even though that is selected in Tools -- Options. It always opens with a blank workspace. I have VS installed over on a non-default D:\ drive -- maybe that has something to do with it. Great video series so far.
@IAmTimCorey5 жыл бұрын
1) Nice! I'll have to try that again. 2) Audience preference mostly. A lot of people seem to prefer to add margins rather than a blank column/row. I figured I'd do it this way and see how people like it. Either is a good choice. And yes, we are putting the defaults in the Shell View. 3) Interesting. Definitely submit a bug report. I know it may not seem like it, but the engineering team does read each report (they just don't always respond). Make sure you are clear on the steps you take and what the results are as well as all diagnostic steps you have taken.
@Boris16455 жыл бұрын
Hi Tim, Great video again. How would you make a multi language WPF user control? Now all the text is hard coded in the control. Can you get this out of a translation table?
@IAmTimCorey5 жыл бұрын
I'm hoping to do a localization video at some point. Basically, you store the translation file that then gets used when the system language changes from the primary language to another language.
@silvercomic5 жыл бұрын
@@IAmTimCorey If you do, be sure to pour one out for all the developers that have to google exception messages in languages other than English. None of the available workarounds seem to work fully. It's apparently a rather nontrivial problem, as discussed here: github.com/Microsoft/dotnet/issues/474
@beautifulheartsoothingreci284 жыл бұрын
@Boris1645 To give a little more detail to what Tim said, for multilanguage support you would add a ResourceDictionary for each language, which contains all the translations, then you just reference it as StaticResources (or DynamicResources if you want to be able to change language during runtime, however careful about performance!) wherever you need a phrase.
@Boris16453 жыл бұрын
@@beautifulheartsoothingreci28 Thanks for taking the time to provide a more detailed response. It's appreciated.
@danielnunes42865 жыл бұрын
Your videos are really amazing 👍. But I would love to see a video creating a web application webform based with a correct way to communicate to a database ex: oracle. And how is the best way to get this connection working. A class with all connections static functions or something else. Many thanks
@IAmTimCorey5 жыл бұрын
Here is a video that will fulfill almost all of your requirements (it is MVC instead of WebForms but that is a minor difference): kzbin.info/www/bejne/mHrMdqmVlLaBrtk
@MauricioCaterino5 жыл бұрын
Hi Tim. I am wondering, isn't better to use datagridview for the cart?.
@IAmTimCorey5 жыл бұрын
I don't think we need that much power.
@danirdd925 жыл бұрын
What is the actual difference between a prop and a propfull? Doesn't auto-props create a private field during compilation using compiler dark voodoo magic?
@IAmTimCorey5 жыл бұрын
Yes(ish). An auto-property has a hidden private backing field. A full property has everything exposed in the code. The difference is that you can manipulate the get or the set.
@99MrX995 жыл бұрын
Any reason you are using BindingList instead of ObservableCollection? I read BindingList is not considered good for WPF.
@antoneriksson2085 жыл бұрын
Isn't IList also a viable option?
@99MrX995 жыл бұрын
@@antoneriksson208 It is possible if you don't plan to add or remove items from the list. ObservableCollection (and also BindingList) implement INotifyCollectionChanged and fires an event when you add or remove elements so the view that binds to that collection get's informed and updates. If you only set the list once or replace it with an new instance an IList or even IEnumerable is enough, though you would net a setter that raises the PropertyChanged event if you set it, like for other properties.
@IAmTimCorey5 жыл бұрын
Great question. This isn't a clear-cut issue. Here are the basics: ObservableCollection (OC for short) fires the INPC event when a record is added or removed. BindingList (BL for short) fires the INPC event when a record is added, removed, or a property changes in one of the items inside of it. So if I have a list of People and I change the FirstName of a person from Bob to Robert, ObservableCollection won't fire the INPC but BindingList will. That is both good and bad. You don't risk old data in the display but the INPC is firing more often and the tree gets traversed more. That makes BL less performant than OC, which is why people like OC for WPF more. It can handle much larger lists. However, unless your list is thousands of items long and constantly changing, BL won't be a problem.
@hmubusin79774 жыл бұрын
Hey thanks for the tutorial! I have a question, If I wanted to pass the data from the login page (for example the email or the name associated with the email from the database) to display on the sales page or use for other purposes, how can I do that in caliburn micro?
@IAmTimCorey4 жыл бұрын
We pass data from one page to the other in this application. We gather the additional information about the user and store it in the class that we then pass around.
@ronaldfredsikwese72355 жыл бұрын
For the Views, will using a Page rather than the UserControl work with Caliburn.Micro?
@IAmTimCorey5 жыл бұрын
Depends on what you want to do with it. If you are opening it as a full window then yes. The way we are doing it, the preferred method is UserControl.
@lokigaming4595 жыл бұрын
An idea that i think would be good to add is an email address changes in the database. My school has an email address for students that recently changed to include the year they started going to school. S
@IAmTimCorey5 жыл бұрын
Good suggestion (and a somewhat tricky one). I'll add it to the list.
@recurringnews5 жыл бұрын
Sorted out!
@IAmTimCorey5 жыл бұрын
Glad you figured it out.
@InayetHadi5 жыл бұрын
You are still using MVC ? I thought Razor Components was the future ?
@99MrX995 жыл бұрын
It's one of the goals in this video series to start with older technologies, like you will find in the industry for some years and then make the switch to new technologies, simulating like it could happen in the real world.
@IAmTimCorey5 жыл бұрын
Couple things. First, yes, we are using older technologies like Alex said. Second, MVC isn't being replaced with Razor Pages. Instead, we are getting an additional option of Razor Pages. MVC and Razor Pages are two different approaches based upon what your project needs. Both are viable options.
Being on a small (or even just single) screen is tough. I'm not sure if you have access to another monitor, but that can help. On the road, I use my iPad as a second screen (using software called Duet). It makes a big difference in the speed you can achieve.
@recurringnews5 жыл бұрын
I had problems with the computer, I backed up the project folder and Github. I brought the backup but it did not work accordingly ...