title: How can i insert a string generated in c# code into xaml button?
body: <p>I am trying to create an offline password manager. There is a function which should generate a password and put it into an entry that is supposed to hold that data. Right now i am struggling to insert a result of generating method from c# code, into xaml button.</p>
  
  <p>I've tried creating an entry within c# code, and assigning a text property to it. 1st thing is i am not sure if that's the right way. 2nd thing is i have no clue what else can i do in order to solve this issue.</p>
  
  <pre><code>//this is the generating button in app
  void OnGenerateClicked(object sender, EventArgs e)
  {
      var passwordEntry = new Entry();
      passwordEntry.SetBinding(Entry.TextProperty, "Haslo");
  
      bool includeLowercase = true;
      bool includeUppercase = true;
      bool includeNumeric = true;
      bool includeSpecial = true;
      bool includeSpaces = false;
      int lengthOfPassword = 12;
      string password = 
          PasswordGeneration.GeneratePassword(includeLowercase, includeUppercase, 
          includeNumeric, includeSpecial, includeSpaces, lengthOfPassword);
      var Haslo = new Entry { Text = password }; 
      // here i've tried to assign the text property to the entry 
      //  "Haslo" but unfortunately it's not working.
  }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>&lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               x:Class="OpassV1.Widoki.ServicePage"&gt;
      &lt;StackLayout Margin="20" VerticalOptions="StartAndExpand"&gt;
          &lt;Label Text="Nazwa" /&gt;
          &lt;Entry Text="{Binding Nazwa}" /&gt; 
          &lt;Label Text="Hasło"/&gt;
          &lt;Entry x:Name="Haslo" Text="{Binding Haslo}"/&gt;
          &lt;Button Text="Genruj hasło" Clicked="OnGenerateClicked" /&gt; 
          &lt;Button Text="Zapisz" Clicked="OnSaveClicked" /&gt;
          &lt;Button Text="Usuń" Clicked="OnDeleteClicked" /&gt;
          &lt;Button Text="Anuluj" Clicked="OnCancelClicked" /&gt;
          &lt;/StackLayout&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>I'd like to display generated password in entry with "Binding Nazwa" after clicking generate button "OnGenerateClicked"</p>
  
  <p>I'm grateful for all the answers :)</p>