Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Access App.Current from within a Control?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 11-07-2006   #1 (permalink)
wackyphill@yahoo.com
Guest


 

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\)
Guest


 

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)
Stoitcho Goutsev \(100\)
Guest


 

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   #4 (permalink)
wackyphill@yahoo.com
Guest


 

Re: Access App.Current from within a Control?

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

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


 

Re: Access App.Current from within a Control?

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

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Folder Access Denied, Unable to display current owner. StrangeDze Vista General 14 02-10-2008 02:56 AM
UAC (user access control) Net Doe Vista file management 2 12-30-2007 04:03 AM
Control Panel access jamien59 Vista General 7 09-30-2007 06:21 PM
how do I keep powershells current directory and dotnets current directory in sync Harald Ums \(2179630\) PowerShell 1 06-21-2007 05:10 PM


Vistax64.com 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 2005-2008

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 47 48 49 50 51