修改ContextDialog对话框内容区域的MaxWidth和MaxHeight

This commit is contained in:
2025-08-23 20:52:23 +08:00
parent eb81cecec1
commit 6d2bc57923
7 changed files with 129 additions and 32 deletions

View File

@@ -1,25 +1,33 @@
using System.Windows;
using System.Windows.Controls;
using DMS.Core.Helper;
using DMS.WPF.Helper;
using DMS.WPF.ViewModels.Dialogs;
using iNKORE.UI.WPF.Helpers;
using iNKORE.UI.WPF.Modern.Controls;
namespace DMS.WPF.Views.Dialogs;
public partial class DeviceDialog
public partial class DeviceDialog : ContentDialog
{
private const int ContentAreaMaxWidth = 1000;
private const int ContentAreaMaxHeight = 800;
public DeviceDialog()
{
InitializeComponent();
this.Opened += OnOpened;
}
private void OnOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
{
//<2F>޸ĶԻ<C4B6><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ<EFBFBD><C8BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD>
var backgroundElementBorder = VisualTreeFinder.FindVisualChildByName<Border>(this, "BackgroundElement");
backgroundElementBorder.MaxWidth = ContentAreaMaxWidth;
backgroundElementBorder.MaxWidth = ContentAreaMaxHeight;
// Log the ProtocolType value
// if (viewModel.Device != null)
// {
// NlogHelper.Info($"DeviceDialog opened. Device ProtocolType: {viewModel.Device.ProtocolType}");
// }
// else
// {
// NlogHelper.Info("DeviceDialog opened. Device is null.");
// }
}
}