Navigating Between Views - FULL STACK WPF (.NET CORE) MVVM #16

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ • 26

  • @Saleca
    @Saleca 4 роки тому

    such a stuck of dopamine. you are really good teacher.
    i must be honest that I lost my way on this factories and interfaces a few episodes back, I do get the Geist but will need to digest each topic at a time. will definitely look for your videos if you have on dependency injection and factories

  • @noahb5019
    @noahb5019 4 роки тому

    Another great video - like one of the other commenters, I was also able to build a "subnavigator" class based on your previous videos, but had problems when thinking in the opposite direction. Pulling the navigation command into the MainViewModel was only obvious in hindsight. Thanks for continuing to add more videos - looking forward to next installments

    • @SingletonSean
      @SingletonSean  4 роки тому

      Thanks Noah, hopefully you were able to solve your subnavigator concerns. I think I will also be implementing a subnavigator in this application. More videos on the way!

    • @noahb5019
      @noahb5019 4 роки тому

      @@SingletonSean Thanks Sean - Yes, I completed a working subnavigator that basically emulates Windows Explorer from within my application. I used a custom template to provide user interactivity for files displayed in a ListView. Users are able to navigate through the directory structure from within the host ViewModel.
      Aside from learning how to route processes in WPF, I think the main concerns I've had are with understanding 2 things:
      1) The reasons behind Dependency Injection make sense, especially having done things the other way and suffering the consequences. The question is WHEN we do stop declaring our dependencies? Obviously, declaring every low-level dependency at the top-level defeats the purpose and just leads to complexity of a different form, as does "hiding" the dependencies by creating more abstraction. Conclusion: at some point, certain classes must hide their dependencies, so what do the general principles used in real-life have to say about good practice on this issue?
      2) Using dependency injection before completely understanding how it works has led to some confusion. In addition, since we've been using the DIC associated with ASP.NET, available documentation is generally concerned with things OTHER than desktop development, which means information may or may not be helpful. In fact, I'm still not clear on when the "Transient" and "Scoped" instances are actually disposed...and if Visual Studio provides a debug option for dynamically determining object lifetime, I don't know about it. For example, if I create a Scoped instance of a class, is it scoped the 'ServiceProvider', the 'App.xaml.cs' file or to the first class that requires the object in its constructor? Naturally, the same question hold for the Transient instance.
      Like any good learner, I've naturally done a lot of work to really clarify points like this - so I have a good idea of the answers... but it really helps to have someone who knows his stuff (that's you) confirm things. I said I wouldn't type a long post, so I must have lied. But I hope you find this "audience feedback" useful and I hope your ultimate goal is to take your courses to a place where they can be monetized, since you are providing real value to me and others.

    • @SingletonSean
      @SingletonSean  4 роки тому +2

      Hey Noah, those are good questions.
      1. Personally, I think it is okay to declare as many dependencies as you need in your dependency injection container. It's okay for the top-level App.cs to know everything about the application, because it is indeed the application. In fact, it probably should know a lot. It also helps having all the dependencies setup in one place.
      2. I 100% agree that desktop development doesn't get much love, hahaha. That's why it's turned into the focus of my channel!
      I haven't investigated any debug options for object lifetime, but I know that you can use Debug -> Windows -> Diagnostic Tools and do memory profiling. You could use this to track objects in your application and see what's instantiated. I was going to try it myself, but my VS is all messed up and says I need to repair, lol.
      As for scoped vs. transient, scoped object instances are indeed scoped to the ServiceProvider, so any class resolved from the ServiceProvider that needs the scoped instance will receive the same instance of the object registered. For transient object instances, these are also controlled by the ServiceProvider, but in this case classes resolved from the ServiceProvider will receive a different/new instance every time.
      Hopefully this clears up some things Noah, thanks for watching! I currently don't have plans to move my courses anywhere for monetization. Maybe in the future, but at this time I'm just having fun providing value to other developers!

  • @feitan8745
    @feitan8745 4 роки тому +1

    Deserves more likes and views.

  • @trungvan597
    @trungvan597 2 роки тому

    Great videos! About the navigations , what could you recommend me or show me some links If we would like to start app by a Login Window. If Ok we go to the Tab View Window (as you are doing), and may be in one of the tab view there is an Advanced search button, click that we open a advanced search dialog window, then result will pass back to the active tab. Many Thank again.

  • @WahidRezgui
    @WahidRezgui 3 роки тому

    This is great.
    You light up my life.

  • @zachbray7258
    @zachbray7258 Рік тому

    What if I want my login page to be able to navigate to different pages other than just the home page? For example, I have a create account button that should take you to the create account page and also the login button that takes you to the home page. It seems like registering it with dependency injection this way doesn't allow for that.

  • @MingWu1994
    @MingWu1994 3 роки тому

    What's the difference in using DataTemplate in app.xaml and DataContext="{Binding Navigator}" in mainwindow.xaml?

  • @adeptinfosysconsultancy9654
    @adeptinfosysconsultancy9654 3 роки тому

    Great tutorial but I need a help how do I able to open a pop-up window

  • @marilu9138
    @marilu9138 4 роки тому

    What content do you recommend to delve into the subject?
    How compatible is this teaching with .Net Core Web?
    i need more examples

    • @SingletonSean
      @SingletonSean  4 роки тому

      Hey Mari, I think it is helpful to setup an application in this manner with domain, database, and front-end layers. However, much of this series is WPF specific, such as binding, Commands, and XAML. That said, basically everything outside of the WPF project is transferrable to a web application. I do expect to expand my channel to cover ASP.NET topics considering I spend a lot of my personal time building ASP.NET applications.

  • @jcturpin8737
    @jcturpin8737 4 роки тому

    Great as always, thank you so much. I was able to create a sub-navigation bar based on a navigation choice from mimicking the previous architecture patterns you taught. I'll probably have to rethink it a bit now, lol, thx. Is this a feature you might consider incorporating? I'm wondering how you might implement such a feature. Regardless, Thank you for continuing with this series!

    • @SingletonSean
      @SingletonSean  4 роки тому +2

      Hey JC, I might get into subnavigation if necessary. I would probably take the same approach as root navigation though. I apologize for the refactoring hahaha, I figured it'd be disrespectful to everyone if I hacked around the problem and didn't address the problem correctly.

    • @pikejuan
      @pikejuan 4 роки тому

      @@SingletonSean Don't apologize for that. Nothing is worse than someone saying "This is not the correct way to do things but i'm just doing it to see it work". Code is expected to change as the project gets more intricate.

  • @faraz-online
    @faraz-online 4 роки тому

    Excellent!

  • @aminejadid2702
    @aminejadid2702 4 роки тому

    Thank you

  • @anaibrahim4361
    @anaibrahim4361 4 роки тому

    so i have to watch all the 15 last episode just to see that trick

    • @SingletonSean
      @SingletonSean  4 роки тому +1

      Haha, sadly yes. I've realized that is the con of having app development walkthroughs rather than single concept tutorials. I plan on having a series dedicated to WPF MVVM navigation, since that seems to be a common issue and is essential for any application.

    • @TheMilliardo
      @TheMilliardo 3 роки тому +4

      @@SingletonSean I'm trying to understand MVVM navigation for almost 6 months, still, fail. After I read and watch a lot on this topic. No one could explain for starters how to do this simple, with login and without the "main" navigation bar.