switch attach/detach buttons in mini_ob to same as those use in ob
This commit is contained in:
1 parent
f9ea4c23d8
commit
449731fb35
1 file changed
+18
-4
@@ -712,6 +712,19 @@ namespace mbts.spark {
|
||||
}
|
||||
}
|
||||
|
||||
private static Image _create_enabled_opacity_style_on_button_image(ImageSource source) {
|
||||
var i = new Image() { Source = Icons.AttachAlgos };
|
||||
var image_style = new Style(typeof(Image));
|
||||
//var visibility_setter = new Setter(Button.VisibilityProperty, Visibility.Collapsed);
|
||||
var opacity_setter = new Setter(Button.OpacityProperty, 0.5);
|
||||
var is_enabled_trigger = new Trigger() { Property = Button.IsEnabledProperty, Value = false };
|
||||
is_enabled_trigger.Setters.Add(opacity_setter);
|
||||
image_style.Triggers.Add(is_enabled_trigger);
|
||||
i.Style = image_style;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public class AttachColumn : FrameworkElementColumnBase<Columns> {
|
||||
readonly Type _mini_or_full_ob_type;
|
||||
readonly string _orderbook_vm_datacontext_binding_path;
|
||||
@@ -753,7 +766,7 @@ namespace mbts.spark {
|
||||
}
|
||||
id = key.ToString();
|
||||
Header = DefaultColumnHeaders.Attach;
|
||||
Width = DefaultColumnWidths.Price;
|
||||
Width = 40;
|
||||
|
||||
_mini_or_full_ob_type = mini_or_full_ob_type;
|
||||
_orderbook_vm_datacontext_binding_path = orderbook_vm_datacontext_path;
|
||||
@@ -781,10 +794,11 @@ namespace mbts.spark {
|
||||
var popup = new System.Windows.Controls.Primitives.Popup();
|
||||
|
||||
#region Attach Button
|
||||
|
||||
// create the attach button and assign the menu to it
|
||||
var attach_button = new Button() {
|
||||
Name = "attach_button",
|
||||
Content = "Attach",
|
||||
Content = _create_enabled_opacity_style_on_button_image(Icons.AttachAlgos)
|
||||
};
|
||||
attach_button.Click += (s, e) => { popup.IsOpen = !popup.IsOpen; };
|
||||
|
||||
@@ -881,7 +895,7 @@ namespace mbts.spark {
|
||||
|
||||
id = key.ToString();
|
||||
Header = DefaultColumnHeaders.Detach;
|
||||
Width = DefaultColumnWidths.Price;
|
||||
Width = 40;
|
||||
|
||||
_mini_or_full_ob_type = mini_or_full_ob_type;
|
||||
_orderbook_vm_datacontext_binding_path = orderbook_vm_datacontext_path;
|
||||
@@ -892,7 +906,7 @@ namespace mbts.spark {
|
||||
public override FrameworkElement view_factory() {
|
||||
var button = new Button() {
|
||||
Name = "detach_button",
|
||||
Content = "Detach"
|
||||
Content = _create_enabled_opacity_style_on_button_image(Icons.DetachAlgos)
|
||||
};
|
||||
|
||||
var orderbook_vm_datacontext_binding = new Binding(_orderbook_vm_datacontext_binding_path);
|
||||
|
||||
Reference in new issue
Block a user