protected override void DoConstruct() { base.DoConstruct(); if (Axis == null) // Can be the case when loading from a save that did not have support for it { Axis = new Ear.PropertyComboBox(); } AxesByDevice = new Dictionary <string, Dictionary <int, Axis> >(); iDeviceInstancePathForAxis = ""; Axis.DisplayMember = "Name"; // Need to be a string property as we save it as a string in CurrentItem. Failing that you won't be able to set current item in ComboBox control. Axis.ValueMember = "FullName"; SetAxisId(); PropertyChanged += EventHidAxis_PropertyChanged; }
protected override void DoConstruct() { base.DoConstruct(); if (Device == null) // Can be the case when loading from a save that did not have support for it { Device = new Ear.PropertyComboBox(); } // Our ComboBox will display our FriendlyName property Device.DisplayMember = "FriendlyName"; // But we will store our InstancePath which uniquely identifies an HID device Device.ValueMember = "InstancePath"; // Our ComboBox sorts our HID devices by name Device.Sorted = true; // UpdateDynamicProperties(); PropertyChanged += EventHid_PropertyChanged; }