how can i make an ivalueconverter fire again. if i resize the screen, causing the xamdatachart to be redrawn the converter runs. I need to force a redraw or figure out how to force the converter to run. Any ideas?
it is a DataTemplate for labels
Hello Pete,
Thank you for posting!
I have been looking through the provided description but I am not completely sure how you use that IValueConverter. Could you post a code snippet representing this or a sample project? Why are you using the converter?
Converters are used to provide custom logic to a binding. The Convert method is fired when data source is changed if a notification for that appears (an implementation of INotifiedPropertyChange interface). If the data source object is not capable of notifying for changes the Convert method will not fire.
Attached is an example. On button changes the lables to old and one to new. The change only takes effect if you click the button, close the app and open it again. i need the labels to update when the button click happens.
Thank you i actually figured it out after your last post. I did something very simliar to this post. Thank you!
Here is a code snippet of the buttons’ event handlers:
private void Button_Click(object sender, RoutedEventArgs e)
{
ButtonChecked = true;
YAxisEvents.RenderAxis();
}
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
ButtonChecked = false;
I have only called the RenderAxis method for the Y axis so that it is refreshed and the new values are displayed.
Please let me know if you need additional assistance on this.
Is there anyway you could edit my project to show me how this will work?
you can call RenderSeries or RenderAxis to indicate to a series or axis that it needs to refresh if you've changed something that doesn't directly invalidate the axis/series.