Hi,
I am pretty new to silverlight, so this may well be nothing to do with the control. I guess i should explain the issue first.
We have a XamRibbon with a number of RibbonTools in it at start up, I am able to then set the buttons IsEnabled as and when I like at runtime with RibbonTool.IsEnabled. This is all fine from the calling thread, but if I try to do this in a callback that's called as a response to an Asyn call to a web service, it still sets the value in the button, but the button still has the look of the last setting, until I pass the mouse over it.
So, for example, I have a RibbonTool and it's IsEnbled is set to false, so the button is greyed out, as expected, if I then set it to IsEnabled from with in a callback, it stays greyed out until I pass the mouse over it.
I have tried calling the Tab the button's in UpdateLayout, have also called the ribbons UpdateLayout as well as the UserControl's UpdateLayout and also all three :S but still no joy.
Can you tell me what I am doing wrong and how I can get this button to display correctly in the UI when the IsEnabled member is set from within a callback method....
Thanks,
Charles
Hello,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post, but it seems like am missing something about your scenario, so if this is still an issue for you, could you please send me an isolated sample project, where this is reproduced, so I can investigate it further for you.
Feel free to write me if you have further questions.
Hi Stefan,
I have not tried it for a while, but at the time of writing my opening post I tried to create a simple example of this behaviour, but alas, it behaved lol
We have quite a layered approach to this at the moment as our application is quite a dynamic one, but I think I have a work around for this. Once I have proved my new method works I'll post it here in detail. But as I can't re create this in a simple sample, the issue may well be particular to how we are using the tool.
Charles.
Hello Charles,
Feel free to write here when you are ready with your method, sample, etc.
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
OK, I have found what the issue is here...
If I set the IsEnabled properties of a ribbon control right after I have displayed a child window, the state gets set but the ribbon button does not visually or functionally take on that change, the button does however report that it's IsEnabled value is set as intended.
If I set the IsEanbled property before the child window is shown, it works fine... so to try and make this clearer, here is some pseudo code:
// This method will fail
void MethodA()
{
RibbonButton.IsEnabled = false;
ChildWindow.Show("Message");
}
// This method works fine...
void MethodB()
Our product is quite complicated, so I have created a simplified version of this that shows this behaviour occurring, personally, I think this is a bug in the Ribbon, what do you guys think?
Oh, and sorry it's taken me so long to get around to this, I have been very busy :S but, better late than never...