mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Lazy Load Image
This commit is contained in:
parent
9d21649622
commit
0e0f24f635
2 changed files with 6 additions and 2 deletions
|
|
@ -42,7 +42,7 @@
|
|||
<ColumnDefinition Width="0" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image x:Name="ImageIcon" Width="32" Height="32" HorizontalAlignment="Left"
|
||||
Source="{Binding Image}" />
|
||||
Source="{Binding Image.Value}" />
|
||||
<Grid Margin="5 0 5 0" Grid.Column="1" HorizontalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ namespace Flow.Launcher.ViewModel
|
|||
if (result != null)
|
||||
{
|
||||
Result = result;
|
||||
Image = new Lazy<ImageSource>(() => SetImage);
|
||||
}
|
||||
|
||||
Settings = settings;
|
||||
|
|
@ -36,8 +37,10 @@ namespace Flow.Launcher.ViewModel
|
|||
public string ShowSubTitleToolTip => string.IsNullOrEmpty(Result.SubTitleToolTip)
|
||||
? Result.SubTitle
|
||||
: Result.SubTitleToolTip;
|
||||
|
||||
public Lazy<ImageSource> Image { get; set; }
|
||||
|
||||
public ImageSource Image
|
||||
private ImageSource SetImage
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -75,6 +78,7 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Result.GetHashCode();
|
||||
|
|
|
|||
Loading…
Reference in a new issue