title: Binding a property obtained from a method, that returns object
body: <p>I have a problem with binding with a XAML file. There is a <code>DataContext</code> of <code>Template</code> class that has a <code>GetDisplayParams()</code> method. Method <code>GetDisplayParams()</code> returns an object of type <code>TemplateDisplayParams</code>, that has a <code>Width</code> property. I just need to bind <code>TextBox</code> to this property, but nothing works for me.</p>
  <p>.xaml:</p>
  <pre><code>&lt;TextBox Text=&quot;{Binding GetDisplayParams.Width}&quot;/&gt; 
  </code></pre>
  <p>.axaml.cs:</p>
  <pre><code>public TemplateCompositeAttributesSettingsView(Scripting.Template dataContext) : this()
  {
      DataContext = dataContext;
      Console.WriteLine( ((Scripting.Template)DataContext).GetDisplayParams().Width ); // return int.
  }
  </code></pre>
  <p>Error:
  <a href="https://i.stack.imgur.com/h0oK6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h0oK6.png" alt="enter image description here" /></a></p>