Here's what I got to so far:
System.Windows.Data.Binding binding = new System.Windows.Data.Binding("MyProperty");
binding.Mode = System.Windows.Data.BindingMode.TwoWay;
binding.Converter = new System.Windows.Controls.BooleanToVisibilityConverter();
binding.Source = mySourceObject;
this.SetBinding(this.myButton.Visibility, binding);
but visibility is not a dependency property, so how can I do this?
You should be able to do
Button.VisibilityProperty
instead of
this.myButton.Visibility
http://msdn.microsoft.com/en-us/library/system.windows.uielement.visibilityproperty.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With