Typo in panadapter.cs (flexlib)

  • 1
  • Problem
  • Updated 3 years ago
Found a typo, I think RaisePropertyChanged should be RFGainStep instead of RFGainHigh  in the snippet below:


private double _rf_gain_step;
        public double RFGainStep
        {
            get { return _rf_gain_step; }
            set
            {
                if (_rf_gain_step != value)
                {
                    _rf_gain_step = value;
                    RaisePropertyChanged("RFGainHigh");
                }
            }
        }
Photo of Robbie - KI4TTZ

Robbie - KI4TTZ

  • 473 Posts
  • 72 Reply Likes

Posted 3 years ago

  • 1
Photo of Tim - W4TME

Tim - W4TME, Customer Experience Manager

  • 8701 Posts
  • 3269 Reply Likes
It is a typo.  Good catch!  We'll get it fixed.  Thanks.
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 655 Posts
  • 198 Reply Likes
For reference, this is issue #1821.
Photo of Peter K1PGV

Peter K1PGV, Elmer

  • 541 Posts
  • 314 Reply Likes
<total aside>
Can I just chime-in with some unsolicited advice? These names of the properties (the argument to RaisePropertyChanged) would ideally be constants, and not require the dev to type-in a string literal at each invocation. Eliminates any chance of typos making it into the released code.  Also, it they were scoped correctly, the consumer of the API could use the same constants when consuming the events.

Sorry, it's the dev manager in me...
</total aside>
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 655 Posts
  • 198 Reply Likes
I agree with you and had the same concerns when we started using the ObservableObject class (which uses the INotifyProperty interface).  This is the industry standard for binding WPF GUI components to C# libraries (see https://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged%28v=vs.110%29....).  Aside from the string issue, it has really worked pretty well.
(Edited)
Photo of Mark Erbaugh

Mark Erbaugh

  • 371 Posts
  • 32 Reply Likes
As someone not familiar with dot net programming and C sharp, why not use a string constant and refactor the constants into a header file?
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 655 Posts
  • 198 Reply Likes
Again, the INotifyProperty interface which uses the string based propertyName variables is the industry standard way of binding WPF GUI components to C# libraries -- especially if using the Model View ViewModel (MVVM) framework.  I, personally, would rather take my licks with the standard that thousands of other developers are using rather than trying to roll my own and not have the support and documentation of millions of lines of code from which others have already learned.