wpf - Custom Dependency Property only fire once -


itemprop = "text">

I created a custom user control and their problem is that the "OnPeriodTypeChangedHandler" property changes call back only once Fire control is designed for the first time, afterwards if I try to call the property through binding, then it does not fire at all. Any ideas?

  # period Period type dependencies for public static reading PerdiTypeProperty = Dependency Property. Registration ( "Piriod type" Taipf (Piriodtip Enam), Taipf (period), new Fremvrkproprtimatetata (Piriodtipanet Knan, Fremvrkproprtimatdataopeshnsofffeyrrender new property Chenjd callback (Onpridataip Chenjedhandlr))); public static void OnPeriodTypeChangedHandler (DependencyObject get from, DependencyPropertyChangedEventArgs e) {// set // public property TaregtCatalogControl say the current control of the sender e.NewValue // property value, eg ((period) from). Prepaid Type = (Periodontal Enam) e.NewValue; If (PeriodTypeEnum) e.NewValue == PeriodTypeEnum.Month) ((Term) Sender) .Periods = ((Term) Sender) .GetMonthlyPeriods (); (PeriodTypeEnum) e.NewValue == PeriodTypeEnum.Quarter) ((Term) Sender) .Periods = ((Term) Sender) .GetQuarterlyPeriods (); } Public PriorityPayment Period Type {Received} Return (Periodotype ANM) gatevalue (Periodontropproperty); } Set {set value (periodontotype, property); If you want to force your DP to bind  by default, you can specify it at the time of DP registration at  FrameworkPropertyMetadataOptions.BindsTwoWayByDefault  in this way you There is no need to set the mode of TwoWay at the time of binding. 

  public static read-only for DependencyProperty PeriodTypeProperty = DependencyProperty.Register ( "PeriodType", typeof (string), typeof (MyTextBox), New FrameworkPropertyMetadata (PeriodTypeEnum.None, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions. BindsTwoWayByDefault, & lt; - New PropertyChangedCallback here (OnPeriodTypeChangedHandler));  

Comments