با سلام
من به تازگی با مشکل فراخوانی کلاس در هنگام تعریف Style شدم
در برنامه استایل جدیدی رو ایجاد کردم
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="WindowNewStyle.WindowsStyle">
<Style x:Key="Window_01" TargetType="{x:Type Window}">
<Setter Property="AllowsTransparency" Value="True"/>
<Setter Property="WindowStyle" Value="None"/>
<Setter Property="Background" Value="Transparent"/>
<EventSetter Event="Loaded" Handler="Load"/>
</Style>
</ResourceDictionary>
درون اون Event مربوط به Loaded رو فرا خونی کردم
درون فرمت لود برنامه هم موارد زیر رو درج کردم
using System;
using System.Windows;


namespace WindowNewStyle.Themplates
{
partial class WindowsStyle
{
bool IsWindowResize=false;
WindowState state = WindowState.Normal;
void Load(object sender,EventArgs e)
{
Window window=sender as Window;
window.WindowStartupLocation=WindowStartupLocation .CenterScreen;
}
}
}
اما با خطای زیر روبرو مشم
WindowsStyle' does not contain a definition for 'Load' and no accessible extension method 'Load' accepting a first argument of type 'WindowsStyle' could be found (are you missing a using directive or an assembly reference?)
ممنون میشم راهنمایی کنید