Files
2026-10-28 17:56:50 +08:00

48 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Store.Management.Framework.Controls.Attach;
/// <summary>
/// 弹出窗口属性值
/// </summary>
public class DialogWindowProperty
{
public static readonly DependencyProperty WindowStartupLocationProperty = DependencyProperty.RegisterAttached(
"WindowStartupLocation", typeof(WindowStartupLocation), typeof(DialogWindowProperty), new PropertyMetadata(WindowStartupLocation.CenterScreen));
public static void SetWindowStartupLocation(DependencyObject element, WindowStartupLocation value)
=> element.SetValue(WindowStartupLocationProperty, value);
public static WindowStartupLocation GetWindowStartupLocation(DependencyObject element)
=> (WindowStartupLocation)element.GetValue(WindowStartupLocationProperty);
public static readonly DependencyProperty ResizeModeProperty = DependencyProperty.RegisterAttached(
"ResizeMode", typeof(ResizeMode), typeof(DialogWindowProperty), new PropertyMetadata(ResizeMode.CanResize));
public static void SetResizeMode(DependencyObject element, ResizeMode value)
=> element.SetValue(ResizeModeProperty, value);
public static ResizeMode GetResizeMode(DependencyObject element)
=> (ResizeMode)element.GetValue(ResizeModeProperty);
public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached(
"Width", typeof(double), typeof(DialogWindowProperty), new PropertyMetadata(double.NaN));
public static void SetWidth(DependencyObject element, double value)
=> element.SetValue(WidthProperty, value);
public static double GetWidth(DependencyObject element)
=> (double)element.GetValue(WidthProperty);
public static readonly DependencyProperty HeightProperty = DependencyProperty.RegisterAttached(
"Height", typeof(double), typeof(DialogWindowProperty), new PropertyMetadata(double.NaN));
public static void SetHeight(DependencyObject element, double value)
=> element.SetValue(HeightProperty, value);
public static double GetHeight(DependencyObject element)
=> (double)element.GetValue(HeightProperty);
}