56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
/*
|
|
* Copyright (c) 2025 LG Electronics Inc.
|
|
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
|
|
*/
|
|
using Aurora.Api;
|
|
using System.Windows;
|
|
using System.ComponentModel;
|
|
using System.Windows.Threading;
|
|
using VisionCommon;
|
|
|
|
namespace VisionUI {
|
|
public partial class ChildImageSettingWindow : Window {
|
|
private static Logger _Logger = new Logger(typeof(ChildImageSettingWindow).Name);
|
|
private FovInfo _FovInfo;
|
|
|
|
public static ChildImageSettingWindow _Instance = null;
|
|
private static readonly object _Lock = new object();
|
|
private delegate void HideWindow();
|
|
|
|
public static ChildImageSettingWindow Instance {
|
|
get {
|
|
lock (_Lock) {
|
|
if (_Instance == null) {
|
|
_Instance = new ChildImageSettingWindow();
|
|
}
|
|
return _Instance;
|
|
}
|
|
}
|
|
}
|
|
|
|
private ChildImageSettingWindow() {
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void Show(FovInfo fovInfo, ICameraDisplay cameraDisplay) {
|
|
_FovInfo = fovInfo;
|
|
if (gridChildImageSettingView.Children.Count == 0) {
|
|
var childImageSettingView = new ChildImageSettingView(_FovInfo, cameraDisplay) {
|
|
DataContext = new ChildImageSettingViewModel(_FovInfo, cameraDisplay)
|
|
};
|
|
gridChildImageSettingView.Children.Add(childImageSettingView);
|
|
}
|
|
this.Show();
|
|
}
|
|
|
|
protected override void OnClosing(CancelEventArgs e) {
|
|
e.Cancel = true;
|
|
Dispatcher.BeginInvoke(DispatcherPriority.Normal, new HideWindow(_HideWindow));
|
|
gridChildImageSettingView.Children.Clear();
|
|
}
|
|
|
|
private void _HideWindow() {
|
|
this.Hide();
|
|
}
|
|
}
|
|
} |