Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Access App.Current from within a Control?

 
 
Old 11-07-2006   #1 (permalink)
wackyphill@yahoo.com


 
 

Access App.Current from within a Control?

I'm subclassing Listview and would like to have that code access an
Application Resource so that each instance of the control doesn't have
its own copy of the resource to save memory. But the following:

App.Current.Resources["MyResource"];

Will not work in this class. It says App does not exist in the current
context. Is there a way around this and still allow the control to be
instantiated in XAML?


My System SpecsSystem Spec
Old 11-07-2006   #2 (permalink)
Stoitcho Goutsev \(100\)


 
 

Re: Access App.Current from within a Control?

Hi,


The class name is Application and Current is static property. The code has
to be

Application.Current.Resource[...]


--
HTH
Stoitcho Goutsev (100)


<wackyphill@yahoo.com> wrote in message
news:1162906054.572237.22540@m73g2000cwd.googlegroups.com...
> I'm subclassing Listview and would like to have that code access an
> Application Resource so that each instance of the control doesn't have
> its own copy of the resource to save memory. But the following:
>
> App.Current.Resources["MyResource"];
>
> Will not work in this class. It says App does not exist in the current
> context. Is there a way around this and still allow the control to be
> instantiated in XAML?
>



My System SpecsSystem Spec
Old 11-07-2006   #3 (permalink)
wackyphill@yahoo.com


 
 

Re: Access App.Current from within a Control?

Man, I feel dumb. Hey thanks Stoitcho I appreciate it.

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
can't open access control editor. Access is denied General Discussion
Folder Access Denied, Unable to display current owner. Vista General
UAC (user access control) Vista file management
how do I keep powershells current directory and dotnets current directory in sync PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46