I have a theme file like this
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:......"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

......

<Style TargetType="local:MItemsControl">

<Setter Property="ItemsPanel" >

<Setter.Value>

<ItemsPanelTemplate>

<local:MItemsPanel x:Name="Mpanel"

Stroke="{Binding Stroke, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:MItemsControl}}"

StrokeThickness="{Binding StrokeThickness, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:MItemsControl}}"


Mtype ="{Binding Mtype, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:MItemsControl}}"


IsItemsHost="True" />


</ItemsPanelTemplate>

</Setter.Value>

</Setter>

.....
.....
</Style>

</ResourceDictionary>



I actually want to Rerender MItemsPanel in runtime.

Let's say the instance of this usercontrol named "uc".
In runtime, when the user do some kind of setting and call uc.invalidatevisual(), uc.Onrender() will run automatically, but the key draw funtions are in class Mpanel, so I actully want to call MItemsPanel.OnRender() or say Mpanel.OnRender().

My tracking result in runtime is : Mpanel.OnRender() will be called only once automatically when uc be initilized. I want to know how to call Mpanel.OnReder() manually or how to call Mpanel.Invalidatevisual().

Class MItemsPanel is in Style, and be initiated under the hood, so I do not know how to check the instance of it.

Thanks again, I hope I explain my goal more clear.