Awesome. Thanx Jonas. Ill be there tomorrow arvo about 3pm. Regards, Philip Beadle Readify | Principal Consultant Microsoft MVP - ASP/ASP.NET, MCAD, MCT Suite 206 Nolan Tower | 29 Rakaia Way | Docklands | VIC 3008 | Australia M: +61 417 301 024 | E: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> | C: [EMAIL PROTECTED]<sip:[EMAIL PROTECTED]> | W: www.readify.net<http://www.readify.net/>
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jonas Follesø Sent: Monday, September 01, 2008 3:24 PM To: [email protected] Subject: Re: [OzSilverlight] Accessing the App.xaml resources Hi, Silverlight does not support binding against static classes. One thing you could do is something like this: Create a simple binding helper class that implements INotifyPropertyChanged, and with one Bool property. Then create a app level resource like this: <Application.Resources> </myapp:BindingHelper x:Key="bindingHelper" /> </Application.Resources> Then in your App_Startup, you can fetch out your InitParam set through HTML when initializing your app. Then do this in App_Startup: ((BindingHelper)Resources["bindingHelper"]).IsVisible = Convert.ToBoolean(e.InitParam["myInitParam"]); Then where ever you need to hide/show stuff in your app you can use standard binding. <Button Enabled="{Binding Path=IsVisible, Path={StaticResource bindingHelper}}" /> See you in Sydney! Cheers, Jonas On Mon, Sep 1, 2008 at 5:06 PM, Philip Beadle <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote: Hi All, What i want to do is bind to a list of items and have a button that is either visible or not depending on an InitParam. Whats the best way to do this? I have tried to make a static resource in App.xaml but i cant access it to change the value. I have a static variable in App.xaml.cs but can't figure out how to write that into the xaml. Cheers Regards, Philip Beadle Readify | Principal Consultant Microsoft MVP - ASP/ASP.NET<http://ASP.NET>, MCAD, MCT Error! Filename not specified. Suite 206 Nolan Tower | 29 Rakaia Way | Docklands | VIC 3008 | Australia M: +61 417 301 024 | E: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> | C: [EMAIL PROTECTED] | W: www.readify.net<http://www.readify.net/> ________________________________ The content of this e-mail, including any attachments is a confidential communication between Readify Pty Ltd and the intended addressee and is for the sole use of that intended addressee. If you are not the intended addressee, any use, interference with, disclosure or copying of this material is unauthorized and prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s). P Please consider your environmental responsibility before printing this e-mail ------------------------------------------------------------------- OzSilverlight.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com<http://mailenable.com> - List managed by www.readify.net<http://www.readify.net> ------------------------------------------------------------------- OzSilverlight.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net ------------------------------------------------------------------- OzSilverlight.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net
