How to call a method in XAML class passing parameters

0

Hello, I'm working with XAML and I'm lost with a problem. I have to, based on a value of type int? I should return the visibility of a TextBox , being Visibility.Collapsed or Visibility.Visible . Example

In XAML class

private Visibility getBtnType(int? id)
{
    return id == null ? Visibility.Visible : Visibility.Collapsed;
}

** No XAML **

<TextBox Visibility="" Text="Is not null" />
<TextBox Visibility="" Text="Oops, is null" />

How do I call this method and still pass a value to it within my XAML?

    
asked by anonymous 14.06.2018 / 15:54

0 answers