修改 主程序下的Comm文件夹 转到 Frameork中
This commit is contained in:
1 parent
2f9c98b105
commit
1eb5315261
78 files changed
+274
-227
No files matched your search
@@ -0,0 +1,82 @@
|
||||
#if HAS_UWP
|
||||
using Windows.UI.Xaml;
|
||||
#elif HAS_WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
#else
|
||||
using System.Windows;
|
||||
#endif
|
||||
|
||||
namespace WxOrder.Framework.Commons.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// This class contains <see cref="IDialogWindow"/> attached properties.
|
||||
/// </summary>
|
||||
public class Dialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies the WindowStyle attached property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This attached property is used to specify the style of a <see cref="IDialogWindow"/>.
|
||||
/// </remarks>
|
||||
public static readonly DependencyProperty WindowStyleProperty =
|
||||
DependencyProperty.RegisterAttached("WindowStyle", typeof(Style), typeof(Dialog), new PropertyMetadata(null));
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value for the <see cref="WindowStyleProperty"/> attached property.
|
||||
/// </summary>
|
||||
/// <param name="obj">The target element.</param>
|
||||
/// <returns>The <see cref="WindowStyleProperty"/> attached to the <paramref name="obj"/> element.</returns>
|
||||
public static Style GetWindowStyle(DependencyObject obj)
|
||||
{
|
||||
return (Style)obj.GetValue(WindowStyleProperty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the <see cref="WindowStyleProperty"/> attached property.
|
||||
/// </summary>
|
||||
/// <param name="obj">The target element.</param>
|
||||
/// <param name="value">The Style to attach.</param>
|
||||
public static void SetWindowStyle(DependencyObject obj, Style value)
|
||||
{
|
||||
obj.SetValue(WindowStyleProperty, value);
|
||||
}
|
||||
|
||||
#if !HAS_UWP && !HAS_WINUI
|
||||
/// <summary>
|
||||
/// Identifies the WindowStartupLocation attached property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This attached property is used to specify the startup location of a <see cref="IDialogWindow"/>.
|
||||
/// </remarks>
|
||||
public static readonly DependencyProperty WindowStartupLocationProperty =
|
||||
DependencyProperty.RegisterAttached("WindowStartupLocation", typeof(WindowStartupLocation), typeof(Dialog), new UIPropertyMetadata(OnWindowStartupLocationChanged));
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value for the <see cref="WindowStartupLocationProperty"/> attached property.
|
||||
/// </summary>
|
||||
/// <param name="obj">The target element.</param>
|
||||
/// <returns>The <see cref="WindowStartupLocationProperty"/> attached to the <paramref name="obj"/> element.</returns>
|
||||
public static WindowStartupLocation GetWindowStartupLocation(DependencyObject obj)
|
||||
{
|
||||
return (WindowStartupLocation)obj.GetValue(WindowStartupLocationProperty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the <see cref="WindowStartupLocationProperty"/> attached property.
|
||||
/// </summary>
|
||||
/// <param name="obj">The target element.</param>
|
||||
/// <param name="value">The WindowStartupLocation to attach.</param>
|
||||
public static void SetWindowStartupLocation(DependencyObject obj, WindowStartupLocation value)
|
||||
{
|
||||
obj.SetValue(WindowStartupLocationProperty, value);
|
||||
}
|
||||
|
||||
private static void OnWindowStartupLocationChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (sender is Window window)
|
||||
window.WindowStartupLocation = (WindowStartupLocation)e.NewValue;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user