Ejemplo n.º 1
0
        private async void SetPropertyValue(string param, EditValueWindow_ViewModel vm)
        {
            var v = JToken.Parse(vm.NewValue);

            Properties.Property(param).Value = v;
            await _container.SetProperty(param, v);
        }
Ejemplo n.º 2
0
        private void EditProperty(string param)
        {
            if (!EditPropertyEnabled(param))
            {
                return;
            }
            var vm = new EditValueWindow_ViewModel();

            vm.OldValue = Properties.Property(param).Value.ToString(Formatting.Indented);
            vm.NewValue = vm.OldValue;
            var window = new EditValueWindow {
                Title = "Edit value of \"" + param + "\"", DataContext = vm
            };

            window.ShowDialog();
            if (vm.IsConfirmed)
            {
                SetPropertyValue(param, vm);
            }
        }