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 CamDeviceSettingWindow : Window {
|
|
private static Logger _Logger = new Logger(typeof(CamDeviceSettingWindow).Name);
|
|
private FovInfo _FovInfo;
|
|
|
|
public static CamDeviceSettingWindow _Instance = null;
|
|
private static readonly object _Lock = new object();
|
|
private delegate void HideWindow();
|
|
|
|
public static CamDeviceSettingWindow Instance {
|
|
get {
|
|
lock (_Lock) {
|
|
if (_Instance == null) {
|
|
_Instance = new CamDeviceSettingWindow();
|
|
}
|
|
return _Instance;
|
|
}
|
|
}
|
|
}
|
|
|
|
private CamDeviceSettingWindow() {
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void Show(FovInfo fovInfo, ICameraDisplay cameraDisplay) {
|
|
_FovInfo = fovInfo;
|
|
if (gridCamDeviceSettingView.Children.Count == 0) {
|
|
var camDeviceSettingView = new CamDeviceSettingView(_FovInfo) {
|
|
DataContext = new CamDeviceSettingViewModel(_FovInfo, cameraDisplay)
|
|
};
|
|
gridCamDeviceSettingView.Children.Add(camDeviceSettingView);
|
|
}
|
|
this.Show();
|
|
}
|
|
|
|
protected override void OnClosing(CancelEventArgs e) {
|
|
e.Cancel = true;
|
|
Dispatcher.BeginInvoke(DispatcherPriority.Normal, new HideWindow(_HideWindow));
|
|
gridCamDeviceSettingView.Children.Clear();
|
|
}
|
|
|
|
private void _HideWindow() {
|
|
this.Hide();
|
|
}
|
|
}
|
|
} |