mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-21 16:14:28 +08:00
0.4.10
自习数据采样优化
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Avalonia;
|
||||
@@ -681,23 +681,33 @@ public partial class MainWindow
|
||||
}
|
||||
|
||||
ClearTimeZoneServiceBindings(_selectedDesktopComponentHost);
|
||||
DisposeComponentIfNeeded(_selectedDesktopComponentHost);
|
||||
|
||||
if (_desktopPageComponentGrids.TryGetValue(placement.PageIndex, out var pageGrid))
|
||||
{
|
||||
pageGrid.Children.Remove(_selectedDesktopComponentHost);
|
||||
}
|
||||
|
||||
// Remove from persisted placement list as well.
|
||||
_desktopComponentPlacements.Remove(placement);
|
||||
|
||||
ClearDesktopComponentSelection();
|
||||
|
||||
ApplyTaskbarActionVisibility(GetCurrentTaskbarContext());
|
||||
|
||||
// 娣囨繂鐡ㄧ拋鍓х枂
|
||||
PersistSettings();
|
||||
}
|
||||
|
||||
private static void DisposeComponentIfNeeded(Border host)
|
||||
{
|
||||
if (TryGetContentHost(host) is Border contentHost && contentHost.Child is Control componentControl)
|
||||
{
|
||||
if (componentControl is IDisposable disposableComponent)
|
||||
{
|
||||
disposableComponent.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenComponentSettings()
|
||||
{
|
||||
if (_selectedDesktopComponentHost is null || _selectedDesktopComponentHost.Tag is not string placementId)
|
||||
@@ -1389,6 +1399,10 @@ public partial class MainWindow
|
||||
if (_desktopPageComponentGrids.TryGetValue(_currentDesktopSurfaceIndex, out var pageGrid))
|
||||
{
|
||||
ClearTimeZoneServiceBindings(pageGrid.Children.OfType<Control>().ToList());
|
||||
foreach (var child in pageGrid.Children.OfType<Border>())
|
||||
{
|
||||
DisposeComponentIfNeeded(child);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var placement in placementsToRemove)
|
||||
|
||||
Reference in New Issue
Block a user