title: x:Bind and nested class in a UWP application
body: <p>I am currently working on a UWP application and I would like to use the compiled binding system.</p>
  
  <p>I have a base that extends the <code>Windows.UI.Xaml.Controls.Page</code> that contains a property <code>ViewModel</code>.</p>
  
  <p>Here the base class of the <code>ViewModel</code> Property :</p>
  
  <pre><code> public class BaseViewModel : INotifyPropertyChanged
   {
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      protected void RaiseOnPropertyChanged([CallerMemberName] string propertyName = "")
      {
        OnPropertyChanged(propertyName);
      }
  
      public void OnPropertyChanged(string propertyName)
      {
        if (PropertyChanged != null)
        {
          PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
      }
  
    }
  </code></pre>
  
  <p>And here my base page :</p>
  
  <pre><code>public abstract class BasePage : Page
  {
  
    public BaseViewModel ViewModel { get; set; }
  
  }
  </code></pre>
  
  <p>The pages of my app extends the <code>BasePage</code> and contain a nester (inner) class that extends the <code>BaseViewModel</code> class. Here a sample code :</p>
  
  <pre><code>public sealed partial class MyPage : BasePage
  {
  
    public sealed class MyViewModel : BaseViewModel
    {
  
        public string Title
        {
          get
          {
            return "Test";
          }
        }
  
      }
  
      public MyPage()
      {
        InitializeComponent();
        ViewModel = MyViewModel();
      }
  }
  </code></pre>
  
  <p>Now, I would like to bind the property <code>Title</code> of the <code>MyViewModel</code> class to my UI. According to <a href="https://msdn.microsoft.com/en-us/library/windows/apps/mt204783.aspx" rel="nofollow">this article</a> and <a href="http://neilmosafi.blogspot.fr/2007/08/dec-06-wpfxaml-xtype-and-nested-classes.html" rel="nofollow">this one</a>, something like that should work :</p>
  
  <pre><code>&lt;TextBlock 
    Text="{x:Bind ViewModel.(namespace:MyPage+MyViewModel.Title)}"  
  /&gt;
  </code></pre>
  
  <p>Unfortunately, I cannot compile. I have several errors on the generated file <code>MyPage.g.cs</code> due to the "+" char. Do you know if the binding on a nested (inner) class is supported in UWP application ? Perhaps it is supported only on WPF app ? :(</p>
  
  <p>Thank you for your help !</p>