Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Please make AddOn be a DependencyObject, not just a plain Object

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Please make AddOn be a DependencyObject, not just a plain Object

    The problem with being a plain Object is that means AddOns cannot have dependency properties. I need the callback for property change that dependency properties have. Given AddOn as is I'll just have to implement a private custom callback system. It would be so much easier if AddOn was a DependencyObject so I could have dependency properties and use their existing callback mechanism. That would be the WPF way to handle the issue.

    --EV
    Last edited by ETFVoyageur; 08-21-2015, 01:44 AM.

    #2
    Perhaps make AddOn be a DependencyObject, not just a plain Object?

    To be clear -- this is a product question / suggestion, not a personal request. I already have my code working using C# events instead of dependency properties.

    It still seems to me, though, that AddOn might want to be a DependencyObject instead of a plain Object.
    • Fundamental type in WPF, and NT is a WPF app
    • Enables AddOns to do things that they cannot do as is

    --EV
    Last edited by ETFVoyageur; 08-21-2015, 01:44 AM.

    Comment


      #3
      Thanks for feedback. Since Add On's can be anything we do not want to force it to be a dependency object else we would be removing part of the use case of add ons.

      Comment


        #4
        Originally posted by NinjaTrader_Brett View Post
        Thanks for feedback. Since Add On's can be anything we do not want to force it to be a dependency object else we would be removing part of the use case of add ons.
        I do not understand. What would you be removing? As a DependencyObject it would still be an Object. It seems to me that your current way is what is limiting AddOn users.

        --EV

        Comment


          #5
          Object is the base class of all .net objects and as such is the least limiting option technically. You can always build upon Object and create your own Dependency object, thus the power of how its implemented.

          Comment


            #6
            Originally posted by NinjaTrader_Brett View Post
            Object is the base class of all .net objects and as such is the least limiting option technically. You can always build upon Object and create your own Dependency object, thus the power of how its implemented.
            Huh?

            Any subclass of Object, such as DependencyObject IS an Object, can be used wherever an Object is needed, and can do everything an Object can do -- and more besides.

            I have no idea what you have in mind when you say "You can always build upon Object and create your own Dependency object".

            --EV

            Comment


              #7
              public MyAddOn : AddOnBase
              {
              public MyDependencyObject MyCoolDepencyObject;
              }

              public MyDependencyObject : DependencyObject
              {
              ...
              }


              Add On is not necessarily a UI object therefor it does not make sense to force it into that role, which is what you do when inheriting from DependencyObject.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by funk10101, Today, 09:43 PM
              0 responses
              6 views
              0 likes
              Last Post funk10101  
              Started by pkefal, 04-11-2024, 07:39 AM
              11 responses
              37 views
              0 likes
              Last Post jeronymite  
              Started by bill2023, Yesterday, 08:51 AM
              8 responses
              44 views
              0 likes
              Last Post bill2023  
              Started by yertle, Today, 08:38 AM
              6 responses
              26 views
              0 likes
              Last Post ryjoga
              by ryjoga
               
              Started by algospoke, Yesterday, 06:40 PM
              2 responses
              24 views
              0 likes
              Last Post algospoke  
              Working...
              X