Microsoft
Software
Hardware
Network
Question : How can I find a UIElement on a WPF application
Hi,
I have a number of Ellipses on the main interface to a WPF application.
I would like to change the properties of these programmatically, but I want to reference them by name (otherwise the code will be huge!!)
I would like something like this:
1:
Ellipse mine = (Ellipse) UIElements.Find["ellipse12"];
I know this is not the correct syntax, but is this approach possible???
Any help would be appreciated.
Best regards,
James
Answer : How can I find a UIElement on a WPF application
It's all correct till it's works :P
But in case of your code you can easily get null, especialy with dynamicly created objects. VisualTreeHelper handles most common errors and FindName is failsafe and requires sainty checks.
Random Solutions
How to create store procedures and pass values in SQL
Memory Advanced ECC Mode with Mixed DIMM Capacities on Dell R710 PowerEdge
Force Outlook 2003 to use encryption connection to Exchange
What technique is being used here?
"bad request" when trying to access 'options' page in Exchange 2010 OWA
Crystal report 2008, draw graph with huge of data.
Iterating through a PDF file (stepping through) for validation purposes
Custom Search Page and Impersonation
Assigning a GPO to specific users and one Server only ?
how do you read a list of links from a sql database SP and print the list on a aspx .NET ASP page C#