![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| 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 Specs![]() |
| | #3 (permalink) |
| 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 Specs![]() |
| | #4 (permalink) |
| Guest | Re: Access App.Current from within a Control? Man, I feel dumb. Hey thanks Stoitcho I appreciate it. |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: Access App.Current from within a Control? Man, I feel dumb. Hey thanks Stoitcho I appreciate it. |
My System Specs![]() |
![]() |
| 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 |