/// <summary>
        /// Constructs a new instance of the PulseWidthModulationControlViewModel class
        /// </summary>
        /// <param name="model">The PulseWidthModulationControlModel associated with this view model.</param>
        public PulseWidthModulationControlViewModel(PulseWidthModulationControlModel model)
            : base(model)
        {
            // Register for channel value change events on the model.  The weak event manager is used here since it helps prevent memory leaks associated
            // with registering for events and lets us be less careful about unregistering for these events at a later time.
            WeakEventManager <PulseWidthModulationControlModel, ChannelValueChangedEventArgs> .AddHandler(model, "DutyCycleChannelValueChangedEvent", DutyCycleValueChangedEventHandler);

            WeakEventManager <PulseWidthModulationControlModel, ChannelValueChangedEventArgs> .AddHandler(model, "FrequencyChannelValueChangedEvent", FrequencyValueChangedEventHandler);
        }
예제 #2
0
        public static PulseWidthModulationControlModel Create(IElementCreateInfo info)
        {
            var model = new PulseWidthModulationControlModel();

#if MUTATE2020
            model.Initialize(info);
#else
            model.Init(info);
#endif
            return(model);
        }