53 lines
3.0 KiB
XML
53 lines
3.0 KiB
XML
<Button x:Class="Client.Application.Components.Skill"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:local="clr-namespace:Client.Application.Components"
|
|
xmlns:converters="clr-namespace:Client.Application.Converters"
|
|
mc:Ignorable="d"
|
|
IsEnabled="{Binding Path=IsButtonActive,ElementName=root,Mode=OneWay}"
|
|
ToolTipService.ShowOnDisabled="True"
|
|
x:Name="root">
|
|
<Button.Resources>
|
|
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
|
<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>
|
|
<DataTemplate x:Key="ToolTipContent">
|
|
<StackPanel MaxWidth="300">
|
|
<TextBlock TextWrapping="Wrap" FontWeight="Bold" FontSize="14" Margin="0,0,0,5">
|
|
<TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} Lv {1}">
|
|
<Binding Path="SkillName" Mode="OneWay" Source="{x:Reference root}"/>
|
|
<Binding Path="Level" Mode="OneWay" Source="{x:Reference root}"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<TextBlock
|
|
TextWrapping="Wrap"
|
|
Text="{Binding Source={x:Reference root},Path=Cost,Mode=OneWay,StringFormat='MP Cost {0}'}"
|
|
Visibility="{Binding Source={x:Reference root},Path=Cost,Converter={StaticResource NullToVisibilityConverter},ConverterParameter=Hidden,Mode=OneWay}"
|
|
/>
|
|
<TextBlock
|
|
TextWrapping="Wrap"
|
|
Text="{Binding Source={x:Reference root},Path=Range,Mode=OneWay,StringFormat='Range {0}'}"
|
|
Visibility="{Binding Source={x:Reference root},Path=Range,Converter={StaticResource NullToVisibilityConverter},ConverterParameter=Hidden,Mode=OneWay}"
|
|
/>
|
|
<TextBlock
|
|
TextWrapping="Wrap"
|
|
Text="{Binding Source={x:Reference root},Path=Description,Mode=OneWay}"
|
|
Visibility="{Binding Source={x:Reference root},Path=Description,Converter={StaticResource NullToVisibilityConverter},ConverterParameter=Hidden,Mode=OneWay}"
|
|
/>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</Button.Resources>
|
|
<Button.Content>
|
|
<Grid>
|
|
<Image Source="{Binding Path=ImageSource,ElementName=root}" Height="32" Width="32" />
|
|
<Rectangle Fill="Black" Opacity=".5" Visibility="{Binding Path=IsReadyToUse,ElementName=root,Converter={StaticResource BooleanToVisibilityConverter},ConverterParameter=Inverted,Mode=OneWay}"/>
|
|
</Grid>
|
|
</Button.Content>
|
|
<Button.ToolTip >
|
|
<ContentControl ContentTemplate="{StaticResource ToolTipContent}"/>
|
|
</Button.ToolTip>
|
|
</Button>
|