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
Passing a structure from VBA in Excel to a C DLL
Robocopy, security perms and local groups
Black screen of death upon turning PC On
Linux under virtual box
100% CPU usage in vCenter but not in taskmanager on the Windows NT 4.0 VM that has been converted
NFS share on FreeNAS
Cannot Replicate FREEBUSY from Exchange 2003 to Exchange 2010 - EVENT 14029, 4003,
Migrate SBS 2003 to Server 2008 R2
Flex Shared Object - Array Collection access
web design vs dev