title: How to update item xaml from another class in UWP
body: <p>Hi everyone i am a newbie in UWP development, i have searched a lot on the net but I have not found the right way to achieve my goal, what i would like to do is update the ui of my MainPage through the use of a class belonging to UiUpdate class. Here's what I'd like to get, this is my MainPage:</p>
  <pre><code>namespace Test_App
  {
      public sealed partial class MainPage : Page
      {
          public MainPage()
          {
              this.InitializeComponent();
          }
      }
  }
  </code></pre>
  <p>This is the relative xaml associated with my MainPage:</p>
  <pre><code>&lt;Page
      x:Class=&quot;Test_App.MainPage&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:Test_App&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;
      xmlns:controls=&quot;using:Microsoft.Toolkit.Uwp.UI.Controls&quot;
      Background=&quot;{ThemeResource ApplicationPageBackgroundThemeBrush}&quot;&gt;
      &lt;Grid&gt;
          &lt;controls:DockPanel&gt;
              &lt;controls:DockPanel Visibility=&quot;Visible&quot;  HorizontalAlignment=&quot;Left&quot; &gt;
                  &lt;Grid&gt;
                      &lt;TextBlock x:Name=&quot;text_one&quot;  HorizontalAlignment=&quot;Right&quot; Margin=&quot;0,50,46,0&quot; VerticalAlignment=&quot;Center&quot; FontWeight=&quot;Bold&quot; /&gt;
                      &lt;TextBlock  x:Name=&quot;text_two&quot; HorizontalAlignment=&quot;Left&quot; VerticalAlignment=&quot;Bottom&quot; FontWeight=&quot;Medium&quot; /&gt;
  
                  &lt;/Grid&gt;
              &lt;/controls:DockPanel&gt;
      &lt;/Grid&gt;
  &lt;/Page&gt;
  </code></pre>
  <p>Now through the UiUpdate class, I would like to update my TextBlocks or any other element of my UI, I found something like this on the net:</p>
  <pre><code>await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync (CoreDispatcherPriority.Normal, () =&gt;
               {
                   // Update texboxt
  
               });
  </code></pre>
  <p>But i can't access in any way in the UiUpdate class the texbox elements of the MainPage i can't do MainPage.text_one .., also i can't find good documentation for what concerns patterns to be applied or other for the realization of my UWP app</p>