Hi,
I'm using NetAdvantage_Silverlight_20103.
I'm trying to bind the IsEnabled - Property of the a "ButtonTool" - Button, but it does'n work. (I a earlier Version (I think 20102) this worked...)
It works on Binding a "normal" Button...
<Application.Resources> <ResourceDictionary> <AppServices:ARGUSnetDBDomainContext x:Key="MyDomainDataContext" /> </ResourceDictionary> </Application.Resources>
<ig:XamRibbon x:Name="ApplicationRibbon" Grid.Column="1" Grid.ColumnSpan="2" IsMinimized="True" > <!-- Quick Access Toolbar --> <ig:XamRibbon.QuickAccessToolbar> <ig:QuickAccessToolbar> <ig:QatPlaceholderTool TargetId="btnSave" TargetType="Tool"/> <ig:QatPlaceholderTool TargetId="btnUndo" TargetType="Tool"/> </ig:QuickAccessToolbar> </ig:XamRibbon.QuickAccessToolbar> <!--Add Tabs to XamRibbon --> <ig:XamRibbon.ApplicationMenu> <ig:XamRibbonApplicationMenu Image="./Resources/Images/16/ARGUS_16.png">
<ig:ButtonTool Caption="Undo" IsQatCommonTool="True" Id="btnUndo" MaximumSize="ImageAndTextLarge" IsEnabled="{Binding Source={StaticResource MyDomainDataContext}, Path=HasChanges}" LargeImage="./Resources/Images/32/undo.png" SmallImage="./Resources/Images/16/undo.png" Click="btnUndoClick" />
Can you please help me?
This is a bug in the control that we're aiming to fix in the forthcoming service release. Thanks for reporting it!
As a workaround you can set your BindingMode to TwoWay:
IsEnabled="{Binding Source={StaticResource MyDomainDataContext}, Path=HasChanges, Mode=TwoWay}"
A colleague of mine advised that in such situations, it's better to have a TwoWay binding.
If, for example, your application opens a ChildWindow, the control will get disabled, and it would break your OneWay binding.
Hope that helps,