Currtently GetFilterConfiguration() of the SearchFilter is called but the GUI filter widget is not updated until it is closed and reopened by the user.
Can we force a GUI redraw/rebuild to make this work?
Currtently GetFilterConfiguration() of the SearchFilter is called but the GUI filter widget is not updated until it is closed and reopened by the user.
Can we force a GUI redraw/rebuild to make this work?
There isn’t a general scheme for doing this, but you have some options.
Generally, a search filter will not have access to the search results though, so this is something you would need to build yourself; keep in mind that several search agents (and filters) can be active at the same time (even multiple of your own kind!), so you might have search results coming from other search agents (or duplicates from your own). The SmartClient also does some post processing of these results in order to combine overlapping results, ignore duplicates and that type of stuff. So with the approach I describe below, you will not have access to the results visualized in the SmartClient, but only the “raw” results produced by your own search agent.
My assumption here is that you only need the results from your own search agent in order to update your search filter? If that is the case, you could model that dependency between the PluginDefinition (that knows the different parts), the SearchDefinition (producing the results), and the SearchUserControlsPlugin that instantiates the “filter widget”. You would need to keep track of the active SearchDefinitions and then let results produced from there flow to the “filter widget” (possibly via the PluginDefinition). I am however curious as to which use case you are trying to support here? Perhaps there are other ways of supporting it?
You can get some level of “dynamic update” of the filter by subscribing to the Changed event of the SearchScope within your class deriving from SearchFilterEditControl. This will fire whenever the selected timespan changes or the list of cameras change (all available via properties on the SearchScope). If that is sufficient for your use case, the code below should be all you need.
public override void Init()
{
SearchScope.Changed += SearchScopeOnChanged;
}
private void SearchScopeOnChanged(object sender, EventArgs e)
{
// Do what you need to do
}