Skip to content

Commit cbb5400

Browse files
committed
Fix Store Layout for Memory leak
1 parent e17ec6a commit cbb5400

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

Flow.Launcher/SettingWindow.xaml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,9 @@
14931493
FontSize="16"
14941494
FontWeight="Bold"
14951495
Text="{Binding Name, Converter={StaticResource TextConverter}}" />
1496+
14961497
<ItemsPresenter />
1498+
14971499
</StackPanel>
14981500

14991501
</Grid>
@@ -1506,21 +1508,17 @@
15061508
</ListBox.GroupStyle>
15071509
<ListBox.ItemsPanel>
15081510
<ItemsPanelTemplate>
1509-
<UniformGrid
1510-
Margin="0,0,17,18"
1511-
HorizontalAlignment="Left"
1512-
VerticalAlignment="Top"
1513-
Columns="3"
1514-
IsItemsHost="True"
1515-
SnapsToDevicePixels="True" />
1511+
<WrapPanel Margin="0,0,0,10" />
15161512
</ItemsPanelTemplate>
15171513
</ListBox.ItemsPanel>
15181514
<ListBox.ItemTemplate>
15191515
<DataTemplate>
15201516
<!-- Hover Layout Style -->
15211517

15221518
<ToggleButton
1523-
Width="{Binding ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}"
1519+
x:Name="StoreListItem"
1520+
Width="216"
1521+
Height="164"
15241522
HorizontalAlignment="Left"
15251523
HorizontalContentAlignment="left"
15261524
Background="Transparent"
@@ -1543,10 +1541,7 @@
15431541
</ControlTemplate>
15441542
</ToggleButton.Template>
15451543

1546-
<Grid
1547-
Height="160"
1548-
HorizontalAlignment="Left"
1549-
VerticalAlignment="Top">
1544+
<Grid HorizontalAlignment="Left" VerticalAlignment="Top">
15501545
<Grid.RowDefinitions>
15511546
<RowDefinition Height="56" />
15521547
<RowDefinition Height="*" />
@@ -1598,7 +1593,6 @@
15981593
</StackPanel>
15991594
<StackPanel
16001595
Grid.Row="1"
1601-
Width="{Binding ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}"
16021596
Margin="0,6,0,0"
16031597
VerticalAlignment="Top"
16041598
Panel.ZIndex="0">
@@ -1656,10 +1650,10 @@
16561650
VerticalAlignment="Stretch"
16571651
Panel.ZIndex="1">
16581652
<Grid.Background>
1659-
<SolidColorBrush Opacity=".95" Color="{DynamicResource HoverStoreGrid}" />
1653+
<SolidColorBrush Opacity="1" Color="{DynamicResource HoverStoreGrid}" />
16601654
</Grid.Background>
16611655
<Grid.ColumnDefinitions>
1662-
<ColumnDefinition Width="{Binding ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}" />
1656+
<ColumnDefinition Width="{Binding Path=ActualWidth, ElementName=StoreListItem}" />
16631657
</Grid.ColumnDefinitions>
16641658

16651659
<StackPanel

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using System;
1212
using System.IO;
1313
using System.Windows;
14+
using System.Windows.Controls.Primitives;
1415
using System.Windows.Data;
1516
using System.Windows.Forms;
1617
using System.Windows.Input;

0 commit comments

Comments
 (0)