public EditorViewModel(IEventAggregator aggregator)
 {
     aggregator.Subscribe(this);
     Items.Add(xmpVm1 = new XMPEditorViewModel {
         DisplayName = "XMP 1"
     });
     Items.Add(xmpVm2 = new XMPEditorViewModel {
         DisplayName = "XMP 2"
     });
     Items.Add(miscVm);
     ActiveItem = Items[0];
 }
        private void BindNotifyPropertyChanged(XMPEditorViewModel vm)
        {
            void UpdateFrequency()
            {
                int?timeps = vm.Profile?.SDRAMCycleTicks * XMP.MTBps + vm.Profile?.SDRAMCycleTimeFC;

                vm.SDRAMCycleTime = timeps / 1000.0;
            }

            UpdateFrequency();
            vm.Profile.Bind(x => x.SDRAMCycleTicks, (s, e) => UpdateFrequency());
            vm.Profile.Bind(x => x.SDRAMCycleTimeFC, (s, e) => UpdateFrequency());

            // Bind timings.
            vm.Profile.Bind(x => x.CLTicks, (s, e) => vm.Refresh());
            vm.Profile.Bind(x => x.CLFC, (s, e) => vm.Refresh());

            vm.Profile.Bind(x => x.RCDTicks, (s, e) => vm.Refresh());
            vm.Profile.Bind(x => x.RCDFC, (s, e) => vm.Refresh());

            vm.Profile.Bind(x => x.RPTicks, (s, e) => vm.Refresh());
            vm.Profile.Bind(x => x.RPFC, (s, e) => vm.Refresh());

            vm.Profile.Bind(x => x.RASTicks, (s, e) => vm.Refresh());

            vm.Profile.Bind(x => x.RCTicks, (s, e) => vm.Refresh());
            vm.Profile.Bind(x => x.RCFC, (s, e) => vm.Refresh());

            vm.Profile.Bind(x => x.RFCTicks, (s, e) => vm.Refresh());
            vm.Profile.Bind(x => x.RFC2Ticks, (s, e) => vm.Refresh());
            vm.Profile.Bind(x => x.RFC4Ticks, (s, e) => vm.Refresh());

            vm.Profile.Bind(x => x.RRDSTicks, (s, e) => vm.Refresh());
            vm.Profile.Bind(x => x.RRDSFC, (s, e) => vm.Refresh());

            vm.Profile.Bind(x => x.RRDLTicks, (s, e) => vm.Refresh());
            vm.Profile.Bind(x => x.RRDLFC, (s, e) => vm.Refresh());

            vm.Profile.Bind(x => x.FAWTicks, (s, e) => vm.Refresh());
        }