Sales Page Creation - A TimCo Retail Manager Video

  • Published on Apr 8, 2019
  • Patreon ($5/month or more gets source code for this course as it comes out):
    Newsletter signup (with exclusive discounts, giveaways, and more):
    Sponsor Info:
    Technologies used in the PVS-Studio code analyzer for finding bugs and potential vulnerabilities:
    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.

Comments • 50

  • Boris1645
    Boris1645 Month ago

    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?

    • IAmTimCorey
      IAmTimCorey  Month ago

      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.

  • Tomas Westerlund
    Tomas Westerlund 2 months ago

    Great video as always! I think a good idea would be to show the planned out design for the view (on paper, in OneNote) beforehand as it would make it easier to follow what's going on. Thanks again, and as always, I'm Tomas!

    • karate kid
      karate kid Month ago

      I would like to second that suggestion. I do it myself on onenote and have a bunch of arrows showing how everything is connected. It helps

    • IAmTimCorey
      IAmTimCorey  2 months ago

      Thanks for the suggestion.

  • Zaibuf
    Zaibuf 3 months ago

    37:20 Meanwhile, coding on a 13,5" laptop xD

    • IAmTimCorey
      IAmTimCorey  3 months ago

      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.

  • fousburner
    fousburner 4 months ago

    Do you commit to the git after every video?

  • Ronald Fred Sikwese
    Ronald Fred Sikwese 4 months ago

    For the Views, will using a Page rather than the UserControl work with Caliburn.Micro?

    • IAmTimCorey
      IAmTimCorey  4 months ago

      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.

  • Dani Rashba
    Dani Rashba 5 months ago

    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?

    • IAmTimCorey
      IAmTimCorey  5 months ago +1

      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.

  • Harag
    Harag 6 months ago

    Great episode Tim, thanks for this, much appreciated. Never done WPF before (being a winforms developer) so it's still something new to me.

  • Kevin Emmrich
    Kevin Emmrich 6 months ago

    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.

    • IAmTimCorey
      IAmTimCorey  6 months ago +1

      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.

  • Dave Wyers
    Dave Wyers 6 months ago

    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?

    • Dave Wyers
      Dave Wyers 6 months ago

      @IAmTimCorey Thanks Tim. I will bear that in mind when selecting controls

    • IAmTimCorey
      IAmTimCorey  6 months ago +3

      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.

    JERRY NAIDOO 6 months ago +1

    Please tell me next video will show how to open another usercontrol / window after a successful login. Been trying for 2 days now. I can do it using code behind on the LoginView.xaml.cs but not from the LoginViewModel.cs

    • IAmTimCorey
      IAmTimCorey  6 months ago +1

      Yep, we will be covering that. I believe in the next video.

  • GIJojo
    GIJojo 6 months ago

    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

    • IAmTimCorey
      IAmTimCorey  6 months ago

      Good suggestion (and a somewhat tricky one). I'll add it to the list.

  • Tinu Murani
    Tinu Murani 6 months ago +1

    Hi Tim,
    Isn't the NotifyOfPropertyChange in the ItemQuantity property suppose to be from ItemQuantity instead of Products?

    • IAmTimCorey
      IAmTimCorey  6 months ago +1

      Yep, that's a copy/paste bug that I missed. Thanks for pointing it out. I'll correct it soon.

  • Alex L
    Alex L 6 months ago +1

    Any reason you are using BindingList instead of ObservableCollection? I read BindingList is not considered good for WPF.

    • IAmTimCorey
      IAmTimCorey  6 months ago +7

      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.

    • Alex L
      Alex L 6 months ago

      @Anton Eriksson 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.

    • Anton Eriksson
      Anton Eriksson 6 months ago

      Isn't IList also a viable option?

  • Alex L
    Alex L 6 months ago +4

    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);

    • IAmTimCorey
      IAmTimCorey  6 months ago +3

      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.

    • Anton Eriksson
      Anton Eriksson 6 months ago +1

      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!

  • Daniel Nunes
    Daniel Nunes 6 months ago

    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

    • IAmTimCorey
      IAmTimCorey  6 months ago

      Here is a video that will fulfill almost all of your requirements (it is MVC instead of WebForms but that is a minor difference):

  • Inayet Hadi
    Inayet Hadi 6 months ago

    You are still using MVC ? I thought Razor Components was the future ?

    • IAmTimCorey
      IAmTimCorey  6 months ago +1

      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.

    • Alex L
      Alex L 6 months ago +3

      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.

  • shahid hussain
    shahid hussain 6 months ago


  • Rodrigo Alarcón
    Rodrigo Alarcón 6 months ago

    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!

    • IAmTimCorey
      IAmTimCorey  6 months ago +1

      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.

  • Mauricio Caterino
    Mauricio Caterino 6 months ago

    Hi Tim. I am wondering, isn't better to use datagridview for the cart?.

    • IAmTimCorey
      IAmTimCorey  6 months ago

      I don't think we need that much power.

  • Korodak
    Korodak 6 months ago +1

    Great tutorial. I'm learning C# and i like WPF and your channel is one of the best which I found in TheXvid. High quality, good teacher. Keep going!

  • recurringnews
    recurringnews 6 months ago

    Sorted out!

  • recurringnews
    recurringnews 6 months ago

    I had problems with the computer, I backed up the project folder and Github. I brought the backup but it did not work accordingly ...