Prism - Using Delegate Commands

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

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

  • @BGFutureBG
    @BGFutureBG 5 ปีที่แล้ว +9

    Brian "I think we can do better" Lagunas ;)
    Love it, thanks!

  • @yannickstoot
    @yannickstoot 3 ปีที่แล้ว +1

    7:06 This gave me the same feeling as those Billy Mays commercials "But wait, there is more!".

  • @DefterNiko
    @DefterNiko 6 ปีที่แล้ว +1

    Great video Brian. Now I need to go and change my setters :P

  • @nitendratiwari3709
    @nitendratiwari3709 2 ปีที่แล้ว +1

    Awesome 👍, thanks for nice video, got same problem

  • @andreikashin
    @andreikashin 4 ปีที่แล้ว +3

    When I hear "We can do better" - I am like a kid in a candy-shop

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

    @Brian Lagunas 1) Thx for all of your shared worked and knowledge !!!! 2) What's about support for multiple parameters ? :-) 3) Using IG at work

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

      1) You're very welcome. Thanks for watching
      2) You would use a MultiBinding with a IMultiValueConverter and some type of complex object to capture multiple parameter values to use in a command.
      3) That's awesome. Which control do you use most?

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

      @@BrianLagunas 1) :-) 2) Ok. Thx for the hint. When I thought about it, I found that named tuples also work and are convenient to use. 3) New in company. The main solution is a dinosaur in WinForm. I think datagrid is most used. But most needed are trees.

  • @fdybz1820
    @fdybz1820 2 ปีที่แล้ว +1

    Hi Brian!. I just started to use Prism and I'm learning a lot with your videos, thanks. I'd know if Prism implements something like a "converter" for changing the type of the CommandParameter.

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

      No, if the parameter type can change just make it an object.

  • @iancarr3923
    @iancarr3923 3 ปีที่แล้ว +1

    Great, thanks!

  • @vimalck1455
    @vimalck1455 ปีที่แล้ว

    Hi Brian, can you please tell me how to stop observing these properties.

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

      There is currently no way to unregister an observed property.

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

    Hi great videos , thanks for all the help, is there are tutorial for Prism 8 anywhere by you, the pluralsight is Prism 7 and its different from Pirsm 8 , thanks.
    Also can we somehow install older version of Prism in Nuget Packages?

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

      There is no major difference in Prism 7 and 8. The Pluralsight course will still work fine. Yes, you can install old packages from NuGet, you just have to select the version you want.

  • @namelastname4077
    @namelastname4077 3 ปีที่แล้ว

    The fact that much Prism doesnt just work as Fody weavers is one of the greatest tragedies in the history of C#
    [AddINotifyPropertyChangedInterface] and [AlsoNotifyFor] turns any poco into an observable object

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

      That’s because Prism is just a collection of patterns and practices. It does not reinvent the wheel. Also, its not intrusive like Fody and does no inject it’s own code into your generated IL.

  • @GAGANDEEP901
    @GAGANDEEP901 ปีที่แล้ว

    Might sound crazy , but is there way to open a exe within an exe. Not in a new window, rather like opening a user control in Window.xaml.

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

    You should make a tutorial explaining Multi Window app in WPF with Prism. I have seen a lot of examples of multi pages but not about Multi WIndow.

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

      I already have a video on this. It's actually a Pluralsight course www.pluralsight.com/courses/prism-showing-multiple-shells

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

    Make another Pluralsight course on "Prism for Xamarin.Forms" (I watched your prism courses)

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

      It's something I need to do, but have not had the time. Thanks for watching my other courses. I hope you found them helpful.

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

    Great video Brian ! Quick question: Does ObserveProperty in Prism support complex properties or they have to be included in the ViewModel? Thanks !

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

      It does support complex properties 😁

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

      @@BrianLagunas Thank you for your reply ! I appreciate it !! Would it be possible to give an example of implementation?

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

      ObservesProperty(()=> Person.FirstName)

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

      @@BrianLagunas Thanks Brian ! By the way your course in Pluralsight is excellent. Thank you for your effort !

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

      Thank you for watching 🙏

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

    Hello Brian, since you do "...command = new DelegateCommand(...)" is it because DependencyInjection cannot inject DelegateCommands?

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

      Correct, you do not inject command objects

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

    Hello, Brian! Great video. Is this video useful to develop UWP apps or just for WPF apps? I've searching on some tutorial about how to use Prism Library + UWP, but I didn't find anything relevant.

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

      Unfortunately, Prism does not currently support UWP.

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

      Brian Lagunas, it’s a pity! Prism is a great framework. I use it a lot when I’m developing with Xamarin.

  • @derrickberg2825
    @derrickberg2825 3 ปีที่แล้ว

    What if I had multiple buttons that execute different commands, how would you simply it to the least amount of code possible?

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

      That depends on the code you are executing. Is it all the same except for a parameter?

    • @derrickberg2825
      @derrickberg2825 3 ปีที่แล้ว

      ​@@BrianLagunasI was working on making a computer info app that would sit in your system tray. I have buttons that copy the corresponding elements value to your clipboard. I wanted to have other buttons execute other methods but wanted to see if there was a way to use only 1 DelegateCommand. Rather then making multiple ones...

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

      You can do that, but I don't think you should.

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

    Is it possible to invert how the boolean property is used with ObservesCanExecute? !IsEnabled isn't supported.

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

      Not in the ObservesCanExecute delegate. That is expecting a property only. You could create another property that does the inversion and use that property instead.

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

      @@BrianLagunasthanks! And great video, I was able to simplify a lot of code after watching.

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

      @@CloudlessEchoes Thanks for watching.

  • @mariodiaz4355
    @mariodiaz4355 3 ปีที่แล้ว +1

    Thanks a lot, I could unblocked me with this video :)

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

      Great to hear. Thanks for watching

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

    i need your help please , i'm creating a new project with prism 7 for WPF , i have a main module that populate the user menu items as per them rule , i need to lunch the view (witch is in another module) from this module ????

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

      Then just navigate to your view. It doesn't matter what module its in.

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

      @@BrianLagunas can you please show me some code , and what if i need to open the new view in a new tab in docking control ?

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

      Start by reviewing all the samples github.com/PrismLibrary/Prism-Samples-Wpf

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

      There is also a lot of documentation: prismlibrary.github.io/docs/wpf/legacy/Introduction.html

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

      I also have a lot of video courses you can watch www.pluralsight.com/authors/brian-lagunas

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

    Thanx :)