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]>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, MCAD, MCT
>
> [image: cid:[email protected]]
>
> Suite 206 Nolan Tower | 29 Rakaia Way | Docklands | VIC 3008 | Australia
> M: +61 417 301 024 | E: [EMAIL PROTECTED] | C:
> [EMAIL PROTECTED] | W: 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 - 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