2025-06-12 13:15:55 +08:00
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using iNKORE.UI.WPF.Modern.Controls;
|
2025-06-26 19:36:27 +08:00
|
|
|
|
using PMSWPF.Models;
|
2025-06-12 13:15:55 +08:00
|
|
|
|
using PMSWPF.ViewModels.Dialogs;
|
|
|
|
|
|
|
|
|
|
|
|
namespace PMSWPF.Views.Dialogs;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class DeviceDialog
|
|
|
|
|
|
{
|
2025-06-26 19:36:27 +08:00
|
|
|
|
public DeviceDialog(Device device)
|
2025-06-12 13:15:55 +08:00
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
2025-06-26 19:36:27 +08:00
|
|
|
|
DataContext = new DeviceDialogViewModel(device);
|
2025-06-12 13:15:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnPrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void OnCloseButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
|
|
|
|
|
{
|
|
|
|
|
|
var deferral = args.GetDeferral();
|
|
|
|
|
|
deferral.Complete();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async void TryOpenAnother(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
// try
|
|
|
|
|
|
// {
|
|
|
|
|
|
// await new TestContentDialog { Owner = Owner }.ShowAsync();
|
|
|
|
|
|
// }
|
|
|
|
|
|
// catch (Exception ex)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// ErrorText.Text = ex.Message;
|
|
|
|
|
|
// ErrorText.Visibility = Visibility.Visible;
|
|
|
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
|
|
|
|
|
|
{
|
2025-06-12 18:41:46 +08:00
|
|
|
|
// ErrorText.Text = string.Empty;
|
|
|
|
|
|
// ErrorText.Visibility = Visibility.Collapsed;
|
2025-06-12 13:15:55 +08:00
|
|
|
|
}
|
2025-06-23 17:01:06 +08:00
|
|
|
|
}
|