42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Windows;
|
|
using VisionCommon;
|
|
|
|
namespace MilUI {
|
|
/// <summary>
|
|
/// Interaction logic for ImageMaskViewWindow.xaml
|
|
/// </summary>
|
|
public partial class ImageMaskViewWindow : Window, IPatternSettingWindow {
|
|
public string WINDOW_TITLE => "Mask Window";
|
|
private ImageMaskView _imageMaskView;
|
|
|
|
public ImageMaskViewWindow(
|
|
PatternAgentBase patternAgent, PatternInfo patternInfo) {
|
|
InitializeComponent();
|
|
SetTitle();
|
|
CreateView(patternAgent, patternInfo);
|
|
}
|
|
|
|
public void SetTitle() {
|
|
Title = WINDOW_TITLE;
|
|
}
|
|
|
|
public void CreateView(
|
|
PatternAgentBase patternAgent, PatternInfo patternInfo) {
|
|
_imageMaskView = new ImageMaskView(patternAgent, patternInfo);
|
|
_imageMaskView.ParentWindow = this;
|
|
gridImageMaskView.Children.Add(_imageMaskView);
|
|
}
|
|
|
|
public void ResetPosition() {
|
|
Left = WindowUtil.GetLeftWithRatioOnMainWindow(0.1);
|
|
Top = WindowUtil.GetTopWithRatioOnMainWindow(0.1);
|
|
}
|
|
|
|
protected override void OnClosing(CancelEventArgs e) {
|
|
((IDisposable)_imageMaskView).Dispose();
|
|
}
|
|
}
|
|
}
|