0

having an XAMl-Button, which should appear conditionally; Condition is like: is object owner same as player -> so Button.Content = sell, else Button.Content = buy

<Button Name="cmdTrade" Width="100" Margin="2" >
    <Button.Style>
         <Style.TargetType="Button">
               <Setter Property="Content" Value="Buy" />
               <Setter Property="Background" Value="LightGreen" />
                     <Style.Triggers>
                          <DataTrigger Binding="{Binding Inhaber}" Value=MainWindow.lblPlayer.Content >
                               <Setter Property="Content" Value="Sell" />
                               <Setter Property="Background" Value="LightCoral" />
                          </DataTrigger>
                     </Style.Triggers>
          </Style>
    </Button.Style>
</Button>
Tony
  • 19
  • 3

0 Answers0