binding attach_button visibility to our new property

This commit is contained in:
Jake Norbut committed 2019-04-04 14:28:02 -05:00
1 parent 4a5dc21427
commit 120d2bbee5
1 file changed
+5 -1
@@ -798,7 +798,7 @@ namespace mbts.spark {
// create the attach button and assign the menu to it
var attach_button = new Button() {
Name = "attach_button",
Content = _create_enabled_opacity_style_on_button_image(Icons.AttachAlgos)
Content = new Image() { Source = Icons.AttachAlgos }
};
attach_button.Click += (s, e) => { popup.IsOpen = !popup.IsOpen; };
@@ -809,6 +809,10 @@ namespace mbts.spark {
attach_button.SetBinding(Button.DataContextProperty, orderbook_vm_datacontext_binding);
attach_button.SetBinding(Button.CommandProperty, new Binding(_begin_attach_command_binding_path));
var row_vm_attach_to_visibility = new Binding("DataContext.is_attachable") { Converter = new mbts.ui.converters.BooleanToVisibilityConverter() };
row_vm_attach_to_visibility.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(MiniOrderBookRowView), 1);
attach_button.SetBinding(Button.VisibilityProperty, row_vm_attach_to_visibility);
#endregion
#region OrderParamsPanel