简体   繁体   中英

Get all textblock's property value on click wp8

quick question,

(im using visual studio 2012/ windows phone 8 application)

how can i get the properties of a textblock on its tap event? i have the tap event :

void item_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    {
        var control = (sender as TextBlock);

        MessageBox.Show(control.Text + ", was tapped!", "Happyness", MessageBoxButton.OK);
    }

i get most of the properties, but the ones i want i dont get, i would like to see what is that textblock's "Grid.Row" property? is that possible?

ah i found it! hopes this help other people aswell, all i did was :

 var myrow = control.GetValue(Grid.RowProperty);

and the result was = 1;

have a good one!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM