You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.8 KiB
70 lines
2.8 KiB
<UserControl |
|
x:Class="StabilityMatrix.Avalonia.Controls.AdvancedImageBoxView" |
|
xmlns="https://github.com/avaloniaui" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls" |
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData" |
|
xmlns:models="clr-namespace:StabilityMatrix.Avalonia.Models" |
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" |
|
d:DataContext="{x:Static mocks:DesignData.SampleImageSource}" |
|
d:DesignHeight="450" |
|
d:DesignWidth="800" |
|
x:DataType="models:ImageSource" |
|
mc:Ignorable="d"> |
|
<Grid> |
|
<controls:AdvancedImageBox |
|
Name="ImageBox" |
|
CornerRadius="4" |
|
Image="{Binding BitmapAsync^}" |
|
SizeMode="Fit"> |
|
<controls:AdvancedImageBox.ContextFlyout> |
|
<ui:FAMenuFlyout> |
|
<ui:MenuFlyoutItem |
|
x:Name="CopyMenuItem" |
|
CommandParameter="{Binding #ImageBox.Image}" |
|
HotKey="Ctrl+C" |
|
IconSource="Copy" |
|
IsEnabled="{OnPlatform Windows=True, |
|
Default=False}" |
|
Text="Copy" /> |
|
</ui:FAMenuFlyout> |
|
</controls:AdvancedImageBox.ContextFlyout> |
|
</controls:AdvancedImageBox> |
|
|
|
<!-- Label pill card --> |
|
<Border |
|
IsVisible="{Binding Label, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" |
|
Grid.Row="0" |
|
Margin="4" |
|
HorizontalAlignment="Left" |
|
VerticalAlignment="Bottom" |
|
BoxShadow="inset 1.2 0 10 1.8 #66000000" |
|
CornerRadius="16"> |
|
<Border.Resources> |
|
<DropShadowEffect |
|
x:Key="TextDropShadowEffect" |
|
BlurRadius="12" |
|
Opacity="0.9" |
|
Color="#FF000000" /> |
|
<DropShadowEffect |
|
x:Key="ImageDropShadowEffect" |
|
BlurRadius="12" |
|
Opacity="0.2" |
|
Color="#FF000000" /> |
|
</Border.Resources> |
|
<Button |
|
Padding="10,4" |
|
Classes="transparent" |
|
CornerRadius="16"> |
|
<StackPanel Orientation="Horizontal" Spacing="6"> |
|
<TextBlock |
|
VerticalAlignment="Center" |
|
Effect="{StaticResource TextDropShadowEffect}" |
|
Text="{Binding Label}" /> |
|
</StackPanel> |
|
</Button> |
|
</Border> |
|
</Grid> |
|
</UserControl>
|
|
|