(GUI): added dropdown list to settings widgets.

This commit is contained in:
morkt
2018-06-06 00:39:19 +04:00
parent c3dee20cba
commit 49ca8f9952
2 changed files with 16 additions and 0 deletions

View File

@@ -191,10 +191,20 @@ namespace GARbro.GUI
};
}
UIElement CreateDropDownWidget (FixedSetSetting setting)
{
return new ComboBox {
Template = (ControlTemplate)this.Resources["BoundDropDownList"],
DataContext = CreateSettingView<object> (setting),
};
}
UIElement CreateSettingWidget<TUnknown> (IResourceSetting setting, TUnknown value)
{
if (setting is FixedGaugeSetting)
return CreateGaugeWidget (setting as FixedGaugeSetting);
if (setting is FixedSetSetting)
return CreateDropDownWidget (setting as FixedSetSetting);
if (value is bool)
return CreateCheckBoxWidget (setting);
if (value is Encoding)