Prism - Using the ViewModelLocator

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ม.ค. 2025

ความคิดเห็น • 27

  • @3l3odor
    @3l3odor 5 ปีที่แล้ว +3

    Short and clear, all that you need to be up and running ! Thank you !

  • @keyvankabirnia2609
    @keyvankabirnia2609 5 ปีที่แล้ว +4

    I really love your tutorials and I know making them takes you lots of time, precious time, and I appreciate that. As many others do, I'm really looking forward to watch your new series of tutorials related to best practices.
    by the way I'm eager to know your own way of implementing splash-screen via wpf-prism that shows the progress of loading modules.

  • @sergiotardo
    @sergiotardo 4 ปีที่แล้ว +2

    Excelent very helpfull,.. only one question, how could I have intellicense in the XAML? when using AutowiredViewModel="True"

    • @BrianLagunas
      @BrianLagunas  4 ปีที่แล้ว +1

      Have you tried using a design DataContext?

    • @sergiotardo
      @sergiotardo 4 ปีที่แล้ว

      @@BrianLagunas mmm no, I really don't know how to do it, do you have a reference o sample of how to use design DataContext? thanks

    • @BrianLagunas
      @BrianLagunas  4 ปีที่แล้ว +1

      @@sergiotardo No I don't, but your favorite search engine can help.

  • @erikjansen9149
    @erikjansen9149 2 ปีที่แล้ว

    I Like your video's and did your PluralSightCourse. However I found that Prism does do ServiceLocators anymore(deprecated). I have a program that gathers data from DB and screen and then(on a Command) does a lot of tech calculations and outputs the results to a PDF or HTM. Where does that (large) part of the program go? The Model? the ViewModel? I thought a service would be logical.

    • @BrianLagunas
      @BrianLagunas  2 ปีที่แล้ว

      Thank you for your support! It is greatly appreciated. Yes, using a service would be my suggestion, maybe more than one service. Hide all the implementation details behind services.

  • @EdonaManona
    @EdonaManona 4 ปีที่แล้ว +1

    Brian, you have great videos, very informative...
    ...However... in your example the App inherits nothing so, 'App.CreateShell()': no suitable method found to override. This is what I've got ;(

    • @BrianLagunas
      @BrianLagunas  4 ปีที่แล้ว +1

      You need to update your App.xaml to be a PrismApplication

  • @moifouss
    @moifouss 6 ปีที่แล้ว +2

    Thanks !

  • @GauravSharma-jq2hp
    @GauravSharma-jq2hp 2 ปีที่แล้ว

    HI Brian,
    One question on this, When we have AutowireViewModel set to true, If we manually create an instance of ViewModel somewhere in application, does the corresponding View automatically binds to that instance also ?

    • @BrianLagunas
      @BrianLagunas  2 ปีที่แล้ว

      No. If you manually create the VM you are responsible for assigning it to the view. The Autowire will still create another instance if it is set to true.

  • @adrianstanev
    @adrianstanev 5 ปีที่แล้ว

    HI Brian! Thank You very much for all tutorials. Very useful. While experimenting, I came across to something strange to me. If I put the View & ViewModel in the same folder (named somehow), the View finds the ViewModel and has the DataContext set. It works even if I remove ...View... and ...ViewModel... from the namespace. How is this happening?

    • @BrianLagunas
      @BrianLagunas  5 ปีที่แล้ว +1

      Yes, this is actually by luck. If the ViewModelLocationProvider finds Views in the namespace, it will replace it with ViewModels in order to find the ViewModel for the view. However, in your case, both the View and VM are in the same folder not named Views, which essentially bypasses the logic that modifies the namespace when trying to find the VM. So yes, that will work. It's just not the recommended pattern.

    • @adrianstanev
      @adrianstanev 5 ปีที่แล้ว +1

      @@BrianLagunas Thank you, Brian.

  • @hovermind
    @hovermind 6 ปีที่แล้ว

    Waiting for pluralsight course "Prism for Xamarin.Forms" (especially modular architecture)

    • @BrianLagunas
      @BrianLagunas  6 ปีที่แล้ว +2

      I'm not sure if I will do another Pluralsight course. I might, but they are not the same company they used to be. I'll have to really think about it.

    • @BrianLagunas
      @BrianLagunas  4 ปีที่แล้ว +1

      Yeah, basically. They dramatically cut author royalties and the personal connection is no longer there. You no longer feel a part of the company, you're just a body to record content.

    • @BrianLagunas
      @BrianLagunas  4 ปีที่แล้ว +1

      That is awesome. Let me know when you publish your first video. You'll do great.

  • @DrLegitimate
    @DrLegitimate 2 ปีที่แล้ว

    Holy cow dude, I really appreciate the time you take to make these videos, but it's 4 minutes until you hit anything that is relevant to the video title.
    Also, your website serving an ad I have to click out of to scroll is a huge dick move.

    • @BrianLagunas
      @BrianLagunas  2 ปีที่แล้ว

      The first 4 minutes include the sponsor of the video, which this video wouldn't have been made without, and an explanation/walkthrough of the code before we modify it which is important to a lot of people. Luckily, you can just fast forward through the parts that aren't important to you.
      That ad that is shown on my website is for my Pluralsight course which helps support my OSS work, blog, videos, and other community contributions. Without it there would be no content from me.
      You want know what's a huge dick move? Wanting everything for free without having to contribute to anything that may actually support the content you want.

  • @rushaalmaksane7892
    @rushaalmaksane7892 5 ปีที่แล้ว +1

    Thanks!