它工作正常:
<Button Width="100" Height="30" Content="Click Me!">
<Button.ToolTip>
<Border Margin="-4,0,-4,-3" Padding="10" Background="Silver">
<Border.BitmapEffect>
<OuterGlowBitmapEffect></OuterGlowBitmapEffect>
</Border.BitmapEffect>
<Label>Nice tooltip</Label>
</Border>
</Button.ToolTip>
</Button>
但是,我希望在有条件时撤销代码。例如:
if(str=="aaa")
MessageBox.Show("All will be o'kay");
else
{
//I would like this code to revoke
/* <Border.BitmapEffect>
<OuterGlowBitmapEffect></OuterGlowBitmapEffect>
</Border.BitmapEffect>
*/
}
怎么做?