I would like to update the image and text of a primary button based upon the click of a child StackButton. While SetImageSource works, SetText does not.
private void Demo_StackButtonClick(object sender, WebFishEyeButtonEventArgs e) { WebFishEyeStackButton button = (WebFishEyeStackButton)e.Button; DemoUpdateParentButtonWithDelay(button.Parent, button); } static void DemoUpdateParentButtonWithDelay(WebFishEyeButton button, WebFishEyeStackButton stackButton) { Storyboard story = new Storyboard() { BeginTime = TimeSpan.FromSeconds(.01) }; story.Completed += (s, args) => DemoUpdateParentButton(button, stackButton); story.Begin(); } static void DemoUpdateParentButton(WebFishEyeButton button, WebFishEyeStackButton stackButton) { BitmapImage bmp = (BitmapImage)stackButton.ImageSource; button.SetImageSource(bmp.UriSource.OriginalString); button.SetText(stackButton.Text); }
In my test in order to update the text and image during button click per your scenario you will only need to update the property of the ImageSource and Text. Here is the snippet:
private void DemoUpdateParentButtonWithDelay(WebFishEyeButton button, WebFishEyeStackButton stackButton) { Storyboard story = new Storyboard() { BeginTime = TimeSpan.FromSeconds(.1) }; story.Completed += (s, args) => { BitmapImage bmp = (BitmapImage)stackButton.ImageSource; button.ImageSource = new BitmapImage(new Uri(bmp.UriSource.OriginalString, UriKind.RelativeOrAbsolute)); button.Text = stackButton.Text; }; story.Begin(); }