2017-06-12 19:09:09 +00:00
|
|
|
using System;
|
2017-06-18 23:50:22 +00:00
|
|
|
using System.ComponentModel;
|
2017-06-12 19:09:09 +00:00
|
|
|
|
2017-06-12 18:45:24 +00:00
|
|
|
namespace Ooui
|
|
|
|
{
|
2017-06-12 20:45:27 +00:00
|
|
|
public abstract class Element : Node
|
2017-06-12 18:45:24 +00:00
|
|
|
{
|
2017-06-12 20:45:27 +00:00
|
|
|
string className = "";
|
|
|
|
public string ClassName {
|
|
|
|
get => className;
|
2017-06-13 07:51:24 +00:00
|
|
|
set => SetProperty (ref className, value, "className");
|
|
|
|
}
|
|
|
|
|
2017-06-18 23:50:22 +00:00
|
|
|
public Style Style { get; private set; } = new Style ();
|
|
|
|
|
2017-06-13 07:51:24 +00:00
|
|
|
string title = "";
|
|
|
|
public string Title {
|
|
|
|
get => title;
|
|
|
|
set => SetProperty (ref title, value, "title");
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hidden = false;
|
|
|
|
public bool IsHidden {
|
|
|
|
get => hidden;
|
|
|
|
set => SetProperty (ref hidden, value, "hidden");
|
2017-06-12 19:09:09 +00:00
|
|
|
}
|
2017-06-15 09:39:19 +00:00
|
|
|
|
|
|
|
protected Element (string tagName)
|
|
|
|
: base (tagName)
|
|
|
|
{
|
2017-06-18 23:50:22 +00:00
|
|
|
Style.PropertyChanged += HandleStylePropertyChanged;
|
|
|
|
}
|
|
|
|
|
|
|
|
void HandleStylePropertyChanged (object sender, PropertyChangedEventArgs e)
|
|
|
|
{
|
|
|
|
SendSet ("style." + Style.GetJsName (e.PropertyName), Style[e.PropertyName]);
|
2017-06-15 09:39:19 +00:00
|
|
|
}
|
2017-06-12 18:45:24 +00:00
|
|
|
}
|
2017-06-12 19:09:09 +00:00
|
|
|
}
|