lundi 2 février 2015

Change content property from dynamically created button in C#


I have dynamically created button in C# using XAML


XAML code:



<Grid Name="mainGrid" Grid.Row="1"></Grid>


and I had created button with this code in C#


C#



Button dugme = new Button();
dugme.Content = "tap me";
dugme.Tapped += dugmelol_Tapped;
mainGrid.Children.Add(dugme);


How can I now change button Content (text) from "tap me" to "tapped ok" in this event.



void dugmelol_Tapped(object sender, TappedRoutedEventArgs e)
{
//should I use binding?
}




Aucun commentaire:

Enregistrer un commentaire