Exemplo n.º 1
0
        protected HardwareAppBinding(DeviceCollectionViewModel deviceViewModel, IAudioDeviceManager audioDeviceManager)
        {
            _deviceCollectionViewModel = deviceViewModel;
            _audioDeviceManager        = audioDeviceManager;
            _commandControlMappings    = new List <CommandControlMappingElement>();

            _settings = StorageFactory.GetSettings();
        }
        protected void Set <T>(ISettingsBag settings, T value, [CallerMemberName] string propertyName = "")
        {
            T existingValue = Get <T>(settings, propertyName);

            if (!Object.Equals(existingValue, value))
            {
                settings[propertyName] = value;
                OnPropertyChanged(propertyName);
            }
        }
        public EarTrumpetHardwareControlsPageViewModel() : base(null)
        {
            _settings = Addon.Current.Settings;
            _devices  = Addon.Current.DeviceCollection;
            Glyph     = "\xE9A1";
            Title     = Properties.Resources.HardwareControlsTitle;

            NewControlCommand             = new RelayCommand(NewControl);
            EditSelectedControlCommand    = new RelayCommand(EditSelectedControl);
            DeleteSelectedControlCommand  = new RelayCommand(DeleteSelectedControl);
            NewFromSelectedControlCommand = new RelayCommand(NewFromSelectedControl);

            _hardwareSettingsWindow = new WindowHolder(CreateHardwareSettingsExperience);

            UpdateCommandControlsList();

            // The command controls list should have no item selected on startup.
            SelectedIndex = -1;
        }
Exemplo n.º 4
0
 static StorageFactory()
 {
     s_globalSettings = App.Current.HasIdentity() ? (ISettingsBag) new Internal.WindowsStorageSettingsBag() : new Internal.RegistrySettingsBag();
 }
 protected T Get <T>(ISettingsBag settings, [CallerMemberName] string propertyName = "")
 {
     return((T)settings[propertyName]);
 }
 public NamespacedSettingsBag(string nameSpace, ISettingsBag bag)
 {
     Namespace  = nameSpace + ".";
     _globalBag = bag;
 }