I need the viewmodel to instruct the XamDataGrid
in the view to just re-read and recolor its cells with minimal problems. I don’t want to mess with the source and do some unstable workarounds with increasing its events (the source may change).
To make it more understandable, I have a global static class that contains some configuration of visual signals that do not affect the data, but only they are presented in the grid (scaling, formatting, etc.). The visual action takes place in the implementation of IValueConverter
, attached to a field that works fine. There is a static event that fires when the cues change, and viewmodels subscribe to it, and events fire properly. Now I just need the event handler to call the grid redraw.
Any suggestions?
EDIT: some code if this helps:
Converter
public class ScaleConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (targetType == typeof(double) || targetType == typeof(double?)) { if (value == null && targetType == typeof(double?)) return null;
DisplayScale global
public class DisplayScale: NotificationObject { private static KeyValuePair<string, double> _ActiveScaling; private static readonly object _lockHandle = new object();
Fields
defined as
// resource <inf:ScaleConverter x:Key="ScaleConverter" /> // field <igDP:Field Name="Deposit" Converter="{StaticResource ScaleConverter}">
source share