An error occurs when it is used for the user. The selected option has a shadow, which affects the display of the interface.
When solving the problem, we always think it is a problem of re-painting and refreshing the interface. So I also found some code on the Internet that is said to be used for refresh and called DoEvents ().
[Csharp]
Public void DoEvents ()
{
DispatcherFrame frame = new DispatcherFrame ();
Dispatcher. CurrentDispatcher. BeginInvoke (DispatcherPriority. Background,
New DispatcherOperationCallback (ExitFrames), frame );
Dispatcher. PushFrame (frame );
}
Public object ExitFrames (object f)
{
(DispatcherFrame) f). Continue = false;
Return null;
}
Public void DoEvents ()
{
DispatcherFrame frame = new DispatcherFrame ();
Dispatcher. CurrentDispatcher. BeginInvoke (DispatcherPriority. Background,
New DispatcherOperationCallback (ExitFrames), frame );
Dispatcher. PushFrame (frame );
}
Public object ExitFrames (object f)
{
(DispatcherFrame) f). Continue = false;
Return null;
} But still cannot.
I tried a lot of methods and finally found a solution from the attributes of popup. Set an attribute. As follows:
<Popup AllowsTransparency = "True">... </Popup>