0

それはうまくいきます:

  <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>
       */
   }

どうやってするの?

4

1 に答える 1

1

notification を発生させるプロパティを作成するだけです。INotifyPropertyChanged インターフェイスを実装できます。コードでプロパティの値を変更し、xaml でバインドします。

于 2012-11-17T12:44:53.600 に答える