mysterious control Error when no Error; possibly a WPF validation bug; thx Eric!
This commit is contained in:
1 parent
7384a11070
commit
ac6a5cd88d
2 files changed
+10
-2
No files matched your search
@@ -50,9 +50,10 @@ namespace mbts.spark {
|
||||
_model = model;
|
||||
accounts = model.factory.accounts;
|
||||
order_types = new ObservableAutoWrapper<IOrderTypeVM, CustomOrderDefinition.CustomOneofCase>(_order_types_model, ot => OrderTypeVMFactory.create(ot, model, security_source));
|
||||
_selected_account = backing(nameof(selected_account), string.Empty, true, val => !String.IsNullOrWhiteSpace(val) && accounts.Contains(val));
|
||||
_selected_account = backing(nameof(selected_account), string.Empty, false, val => !String.IsNullOrWhiteSpace(val) && accounts.Contains(val));
|
||||
_selected_time_in_force = backing(nameof(selected_time_in_force), TimeInForce.Undefined, false, time_in_forces.Contains);
|
||||
InlineOrderProperties props = new InlineOrderProperties();
|
||||
auto_select_prop(props.account, _selected_account, accounts, () => model.factory.default_account);
|
||||
_dispose = Disposable.Create(
|
||||
security_source.ObserveOnDispatcher().Subscribe(s => {
|
||||
security = s;
|
||||
|
||||
@@ -10,12 +10,13 @@ using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using OrderState = bts.api.orderman.OrderState;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
namespace mbts.spark.utilities {
|
||||
// at some point, user-default settings for orders can be managed here
|
||||
// OrdersModel imports and exposes OrderFactory as a public property
|
||||
[Export(typeof(OrderFactory))]
|
||||
class OrderFactory {
|
||||
class OrderFactory : IDisposable {
|
||||
static readonly OrderMetadata _default_order_metadata = new OrderMetadata { KeyBinding = "", Color = BTSColors.pinkalicious };
|
||||
static readonly CustomOrderDefinition.CustomOneofCase[]
|
||||
_standard_types = new[] {
|
||||
@@ -32,6 +33,7 @@ namespace mbts.spark.utilities {
|
||||
};
|
||||
readonly string _user;
|
||||
readonly AdminModel _admin_model;
|
||||
IDisposable _dispose;
|
||||
|
||||
[ImportingConstructor]
|
||||
public OrderFactory([Import("username")]string user, AdminModel admin_model) {
|
||||
@@ -42,6 +44,7 @@ namespace mbts.spark.utilities {
|
||||
|
||||
|
||||
var admin_data_sequence = _admin_model.on_admin_data
|
||||
.ObserveOnDispatcher()
|
||||
.Subscribe(admin_data => {
|
||||
List<string> account_names = new List<string>();
|
||||
List<string> user_names = new List<string>();
|
||||
@@ -64,6 +67,7 @@ namespace mbts.spark.utilities {
|
||||
accounts = account_names.ToArray();
|
||||
users = new HashSet<string>(user_names).Ordered().ToLArray();
|
||||
});
|
||||
_dispose = Disposable.Create(admin_data_sequence);
|
||||
}
|
||||
|
||||
#region Defaults
|
||||
@@ -207,6 +211,9 @@ namespace mbts.spark.utilities {
|
||||
default: return _default_order_metadata;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose() =>
|
||||
Disposable.dispose(ref _dispose);
|
||||
}
|
||||
|
||||
static class OrderDataHelper {
|
||||
|
||||
Reference in new issue
Block a user