Print Page | Close Window

Get the x:Name property dynamicly

Printed From: Codejock Forums
Category: General
Forum Name: XAML Snippets
Forum Description: Post your XAML snippets here for everyone to enjoy :)
URL: http://forum.codejock.com/forum_posts.asp?TID=18270
Printed Date: 27 April 2024 at 1:05pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Get the x:Name property dynamicly
Posted By: sand.fj.wen
Subject: Get the x:Name property dynamicly
Date Posted: 25 April 2011 at 5:28am
Hi,
I am programming with CXTPMarkupObject these days, now there is a question puzzles me... I set the Run element with Property x:Name="total_count" in a xaml file like this:

<Run x:Name="total_count" MouseLeftButtonUp="Run_MouseLeftButtonUp">...</Run>
<Run x:Name="item_first" MouseLeftButtonUp="Run_MouseLeftButtonUp">...</Run>
<Run x:Name="item_second" MouseLeftButtonUp="Run_MouseLeftButtonUp">...</Run>

when click on the Run element, Run_MouseLeftButtonUp() method is called, but in the Run_MouseLeftButtonUp(), I want to get the clicked Run element's x:Name property, so that I can deal with different method, how can I get the x:Name property in programming?

Thanks, best regards!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net