EventHandler for ValueChanging(Changed) in ActiPro 19.1.0685

Docking/MDI for WPF Forum

Posted 4 years ago by Chris Jasniewski - Consultant, BNP Paribas
Version: 19.1.0686
Avatar

I am using ActiPro 19.1.0685 and upgrading from version 11. Had EventHandler<ItemRoutedEventArgs<T>> . I noticed that version 19 do not have template in EventHandler. How to code handlers around ValueChanging (Changed).

Comments (5)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If you are upgrading from the pre-2016.1 codebase of Docking/MDI, you'll want to look at the Docking/MDI's "Converting to 2016.1" topic in the documentation that comes with the product.  That walks through the main breaking changes for things that were renamed or updated.  If an event is still there but had an event handler type change, you can look at the API now to see what the current event args are.


Actipro Software Support

Posted 4 years ago by Chris Jasniewski - Consultant, BNP Paribas
Avatar

I noticed that EventHandler for editors:DoubleEditBox do not have template <ActiproSoftware.Windows.PropertyChangedRoutedEventArgs>.

Of course i can recode some of callback as private void OnValuesChangedClick(object sender, EventArgs e), but some want to compare oldValue to newValue, which is part of PropertyChangedRoutedEventArgs.  How to code around it? 

I need code like:

void txtHedgePx_ValueChanging001(object sender, ActiproSoftware.Windows.PropertyChangingRoutedEventArgs<double?> e)
{
   if (e.OldValue.HasValue && e.NewValue.HasValue)
  {
       double gap = Math.Abs(Math.Abs(e.OldValue.Value - e.NewValue.Value) - 0.01);
      if (gap <= 0.000001)
      {
                e.NewValue = Math.Round(e.NewValue.Value, 10);
      }
  }
}

I add event here. Problem is that ValueChanged is defined as: public event EventHandler ValueChanged; Template ios gone. In version 11 I used to have public event EventHandler<PropertyChangedRoutedEventArgs> ValueChanged; that is why below code worked.

txtCBQty.ValueChanged += new EventHandler<ActiproSoftware.Windows.PropertyChangedRoutedEventArgs<double?>>(xtHedgePx_ValueChanging001);

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Chris,

Unfortunately the PartEditBoxBase.ValueChanged event doesn't pass the old value now.  You would have to track the old value externally if you wished to continue using that event.  Such as perhaps you could store the old value in the control's Tag property, then do your comparison and update Tag in the event handler.

That being said, there is a protected virtual OnValueChanged method that is passed the old and new values.  Perhaps you could override that instead if you need the old value?


Actipro Software Support

Posted 4 years ago by Chris Jasniewski - Consultant, BNP Paribas
Avatar

One more thing.... When i start my application i am getting license warning screen saying that i need to purchase license.  When I installed ActiPro I put my license key properly.  Why I am getting this screen?  Is it a way to not display it?Thanks,

Chris 

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Please contact our support e-mail address with this question and we will work with you privately to solve it.  If the license information was entered properly, you shouldn't be seeing a license dialog.


Actipro Software Support

The latest build of this product (v24.1.2) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.