Skip to content

Commit

Permalink
Added: More Memory Shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Aug 8, 2022
1 parent b6c77bf commit b199139
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
ToolTipService.InitialShowDelay="250"
VerticalAlignment="Stretch"
VerticalContentAlignment="Top"
VirtualizingStackPanel.VirtualizationMode="Recycling"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.VirtualizationMode="Recycling"
PreviewKeyDown="KeyboardControls_KeyDown"
dd:DragDrop.IsDragSource="True"
dd:DragDrop.IsDropTarget="True">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@
VerticalAlignment="Stretch"
VerticalContentAlignment="Top"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
VirtualizingStackPanel.VirtualizationMode="Recycling"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.VirtualizationMode="Recycling"
PreviewKeyDown="OnPressKeyInListView"
IsSynchronizedWithCurrentItem="True">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<StackPanel>

<!-- Application Image -->
<Border x:Name="BannerImage" BorderBrush="{DynamicResource BorderColorBrush}" Background="Transparent" BorderThickness="1">
<Border BorderBrush="{DynamicResource BorderColorBrush}" Background="Transparent" BorderThickness="1">
<Viewbox>
<Image ToolTip="{DynamicResource AddAppImageTooltip}"
ToolTipService.InitialShowDelay="0"
Expand Down Expand Up @@ -170,7 +170,6 @@
<!-- List of Mods -->
<Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="{DynamicResource PanelMargin}">
<ListView
x:Name="ModListView"
HorizontalAlignment="Stretch"
ItemsSource="{Binding Source={StaticResource SortedMods}}"
SelectedItem="{Binding SelectedModTuple, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ public partial class ManageModsPage : ReloadedIIPage, IDisposable
private readonly CollectionViewSource _modsViewSource;
private readonly CollectionViewSource _appsViewSource;
private bool _disposed;
private MainWindow _mainWindow;

public ManageModsPage() : base()
{
SwappedOut += Dispose;
InitializeComponent();
ViewModel = Lib.IoC.GetConstant<ManageModsViewModel>();
this.DataContext = ViewModel;
Lib.IoC.Get<MainWindow>().Closing += OnMainWindowClosing;
_mainWindow = Lib.IoC.GetConstant<MainWindow>();
_mainWindow.Closing += OnMainWindowClosing;

// Setup filters
var manipulator = new DictionaryResourceManipulator(this.Contents.Resources);
Expand All @@ -35,7 +37,9 @@ public void Dispose()

_disposed = true;
SaveCurrentMod();
Lib.IoC.Get<MainWindow>().Closing -= OnMainWindowClosing;
_modsViewSource.Filter -= ModsViewSourceOnFilter;
_appsViewSource.Filter -= AppsViewSourceOnFilter;
_mainWindow.Closing -= OnMainWindowClosing;
}

private void OnMainWindowClosing(object sender, CancelEventArgs e) => Dispose();
Expand Down

0 comments on commit b199139

Please sign in to comment.