Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Base64 Image] Click on save or view while no input made the app crashing #529

Merged
merged 1 commit into from
May 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/dev/impl/DevToys/UI/Controls/ImagePreview.xaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<UserControl
x:Class="DevToys.UI.Controls.ImagePreview"
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:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
xmlns:converters="using:DevToys.UI.Converters"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400"
SizeChanged="UserControl_SizeChanged">
<UserControl.Resources>
<converters:NullToVisibilityConverter x:Key="NonNullToVisibilityConverter" IsInverted="True"/>

<Style x:Key="CardStyle" TargetType="Grid">
<Setter Property="BorderBrush" Value="{ThemeResource ExpanderHeaderBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource ExpanderHeaderBorderThickness}" />
Expand Down Expand Up @@ -49,6 +51,7 @@
AutomationProperties.LabeledBy="{Binding ElementName=HeaderTextBlock}">
<Button
AutomationProperties.Name="View"
Visibility="{x:Bind Source, Mode=OneWay, Converter={StaticResource NonNullToVisibilityConverter}}"
Click="ViewButton_Click">
<StackPanel Orientation="Horizontal" Spacing="4">
<FontIcon Glyph="&#xF3FB;"/>
Expand All @@ -58,12 +61,14 @@
<Button
ToolTipService.ToolTip="{Binding Instance.Common.Copy, Mode=OneTime, Source={StaticResource LanguageManager}}"
AutomationProperties.Name="{Binding Instance.Common.Copy, Mode=OneTime, Source={StaticResource LanguageManager}}"
Visibility="{x:Bind Source, Mode=OneWay, Converter={StaticResource NonNullToVisibilityConverter}}"
Click="CopyButton_Click">
<FontIcon Glyph="&#xF32B;"/>
</Button>
<Button
ToolTipService.ToolTip="{Binding Instance.Common.SaveAs, Mode=OneTime, Source={StaticResource LanguageManager}}"
AutomationProperties.Name="{Binding Instance.Common.SaveAs, Mode=OneTime, Source={StaticResource LanguageManager}}"
Visibility="{x:Bind Source, Mode=OneWay, Converter={StaticResource NonNullToVisibilityConverter}}"
Click="SaveAsButton_Click">
<FontIcon Glyph="&#xF67F;"/>
</Button>
Expand Down