PR suggestion, thx John!

This commit is contained in:
Jake Norbut committed 2018-05-15 12:22:35 -05:00
1 parent 4a517adefb
commit 2d37f88553
2 files changed
+9 -5

No files matched your search

@@ -54,11 +54,7 @@ namespace mbts.spark {
model.factory.subscribe_accounts(),
order_properties.Select(ops => ops.account),
() => string.Empty,
new PropertyValidation<string>[] {
new PropertyValidation<string>(
val => (!String.IsNullOrWhiteSpace(val) && accounts.Contains(val), "Please select an account")
)
}
val => (!String.IsNullOrWhiteSpace(val) && accounts.Contains(val), "Please select an account")
);
_time_in_force = backing(
nameof(selected_time_in_force),
@@ -380,6 +380,14 @@ namespace mbts.ui.shell
protected SelectorProperty<T> backing<T>(string name, IObservable<IEnumerable<T>> items, IObservable<InlineUserProperty<T>> desired_item, Func<T> select_default, params Func<T, bool>[] validation_steps) =>
backing(name, items, desired_item, select_default, validation_steps.Select(v => new PropertyValidation<T>(v)).ToList());
/// <summary>
/// Returns a SelectorProperty&lt;T&gt; that observes an items source, and a desired item. When either observable ticks, it determines whether or not to assign the selected_item property.
/// This overload makes it a little easier to access the overload where a message is supplied to the validation logic.
/// <para/>Notes: If the user has selected an item (ie the selected_item has been assigned through the public setter), the desired item will be ignored unless force_override is true.
/// <para/>If the user has not selected an item, but the current items do not contain the desired item, it will re-evaluate whether or not to select the item when new items arrive. /// </summary>
protected SelectorProperty<T> backing<T>(string name, IObservable<IEnumerable<T>> items, IObservable<InlineUserProperty<T>> desired_item, Func<T> select_default, params Func<T, (bool valid, string msg)>[] validation_steps) =>
backing(name, items, desired_item, select_default, validation_steps.Select(v => new PropertyValidation<T>(v)).ToList());
/// <summary>
/// Returns a SelectorProperty&lt;T&gt; that observes an items source, and a desired item. When either observable ticks, it determines whether or not to assign the selected_item property.
/// <para/>Notes: If the user has selected an item (ie the selected_item has been assigned through the public setter), the desired item will be ignored unless force_override is true.