This repository has been archived on 2026-03-14. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Eco/VideoBrowserTestApp/Helpers/WindowFactory.cs
2023-07-24 12:00:34 +02:00

38 lines
1.4 KiB
C#

namespace VideoBrowserTestApp.Helpers
{
using MahApps.Metro.Controls;
using System.Windows;
/// <summary>
/// Defines the <see cref="WindowFactory" />.
/// </summary>
internal static class WindowFactory
{
#region Methods
/// <summary>
/// The Create.
/// </summary>
/// <param name="view">The view<see cref="FrameworkElement"/>.</param>
/// <param name="ownerWindow">The ownerWindow<see cref="Window"/>.</param>
/// <returns>The <see cref="MetroWindow"/>.</returns>
internal static MetroWindow Create(FrameworkElement view, Window ownerWindow)
{
var window = new MetroWindow { Content = view, MinWidth = 600, MinHeight = 400, SizeToContent = SizeToContent.WidthAndHeight, Owner = ownerWindow };
return window;
}
/// <summary>
/// The CreateAndShow.
/// </summary>
/// <param name="view">The view<see cref="FrameworkElement"/>.</param>
/// <param name="ownerWindow">The ownerWindow<see cref="Window"/>.</param>
internal static void CreateAndShow(FrameworkElement view, Window ownerWindow)
{
var window = new Window { Content = view, MinWidth = 600, MinHeight = 400, SizeToContent = SizeToContent.WidthAndHeight, Owner = ownerWindow };
window.Show();
}
#endregion Methods
}
}