using System;
using System.Collections.Generic;
using System.Configuration;
using System.Windows;
using System.Windows.Media;
using InABox.Core;

namespace InABox.DynamicGrid
{
    
    public delegate void EditorControlValueChangedHandler(IDynamicEditorControl sender, Dictionary<string, object?> values);
    
    public interface IDynamicEditorControl
    {
        string ColumnName { get; set; }

        bool Loaded { get; set; }
        bool Changed { get; set; }
        
        IBaseEditor EditorDefinition { get; set; }

        bool IsEnabled { get; set; }
        void SetFocus();
        int DesiredHeight();

        event EditorControlValueChangedHandler OnEditorValueChanged;

        void Configure();

        void SetEnabled(bool enabled);

        void SetVisible(bool enabled);

        void SetValue(string property, object? value);

        object? GetValue(string property);
        
        IDynamicEditorHost Host { get; set; }
    }

    public interface IDynamicEditorControl<T> : IDynamicEditorControl
    {
        public T Value { get; set; }

        public Type ValueType { get; set; }
    }
}