using KioskApp.Portal;

namespace KioskApp.Portal.Widgets;

public abstract class Widget
{
    private Window _parentWindow = null!;
    
    public void Initialize(Window parentWindow)
    {
        _parentWindow = parentWindow;
        InternalCreate();
        OnInitialized();
    }
    
    public Window GetParentWindow()
    {
        return _parentWindow;
    }
    
    protected virtual void InternalCreate() {}
    public abstract void Resize(int width, int height);
    
    public virtual void Dispose() {}
    
    public virtual void OnInitialized() {}
}