<local:CustomWindow x:Class="Hexagon_V2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:local="clr-namespace:Hexagon_V2" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="450" Width="800" WindowStyle="None" AllowsTransparency="True" CornerRadius="30" Background="Aqua"> <Grid> </Grid></local:CustomWindow>
public partial class MainWindow : CustomWindow{ public MainWindow() { InitializeComponent(); }}
using System.Windows;namespace Hexagon_V2{ public class CustomWindow : Window { public int CornerRadius { get { return (int)GetValue(CornerRadiusProperty); } set { SetValue(CornerRadiusProperty, value); } } public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(int), typeof(CustomWindow), new PropertyMetadata(0)); static CustomWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomWindow), new FrameworkPropertyMetadata(typeof(CustomWindow))); } }}