title: WINUI3 - Customize TitleBar
body: <p>Just a quick clarification needed regarding .setTitleBar() usage.</p>
  <p><em>MainWindow.xaml</em></p>
  <pre><code>&lt;Window
      
      x:Class=&quot;Wrath.MainWindow&quot;
      xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
      xmlns:local=&quot;using:Wrath&quot;
      xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
      xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
      mc:Ignorable=&quot;d&quot;&gt;
      
      &lt;Grid&gt;
          &lt;!-- ... --&gt;
          &lt;TextBlock x:Name=&quot;CustomTitleBar&quot;&gt;Custom title text&lt;/TextBlock&gt;
  
          &lt;!-- ... --&gt;
  
  
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  <p><em>MainWindow.xaml.cpp</em></p>
  <pre><code>MainWindow::ExtendsContentIntoTitleBar(true);
  MainWindow::SetTitleBar(?);
  </code></pre>
  <p><strong>How do I reference the xaml element as argument in the SetTitleBar function?</strong></p>
  <p>This is based on the example (only for .cs) provided from:</p>
  <p><a href="https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.window.settitlebar?view=winui-3.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.window.settitlebar?view=winui-3.0</a></p>