저는`WPF \ Telerik Project '에서 일하고 있습니다. 나는 매우 이상한 문제를 겪었는데, 기능의 상호 의존성으로 인해 나는 일을 사용할 수 없다.'[WPFApplication] .MainWindow'의 부분 선언은 다른 기본 클래스를 지정해서는 안됩니다.
내 프로젝트에 자동 로그 아웃 기능이 있으며이를 위해 다음과 같이이 코드를 사용해야합니다. 이 코드 HwndSource windowSpecificOSMessageListener = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
라인
private void InitializeAutoLogoffFeature()
{
HwndSource windowSpecificOSMessageListener = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
windowSpecificOSMessageListener.AddHook(new HwndSourceHook(CallBackMethod));
LogOffHelper.LogOffTime = logOffTime;
LogOffHelper.MakeAutoLogOffEvent += new MakeAutoLogOff(AutoLogOffHelper_MakeAutoLogOffEvent);
LogOffHelper.StartAutoLogoffOption();
}
나는 창 (this
)을 통과해야합니다.
[Window_Name]
창은 Window
을 사용하여 구현해야합니다. WindowInteropHelper
생성자는 Window
유형 만 허용하기 때문입니다.
public partial class MainWindow : Window
{
는 belows로 I impliments 내가 오류를 얻을 때
는하지만,
Partial declarations of '[WPFApplication].MainWindow' must not specify different base classes
이 MainWindow
Window
자사의
Telerik window
없습니다.
XML은 다음과 같습니다.
<telerik:RadWindow x:Class="[WPFApplication].MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Header="POS" Height="820" Width="1280"
WindowStartupLocation="CenterScreen">
<telerik:RadWindow.Resources>
..
이 나는 또한 내가이 오류를 극복하는 방법을
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
new MainWindow().Show();
base.OnStartup(e);
}
}
App.xaml.cs
에서뿐만 아니라이 코드를 사용하여 시도
<Application x:Class="[WPFApplication].App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow"
>
<Application.Resources>
</Application.Resources>
내 App.xaml
입니까?
에 표준 WPF 창을 통과 (http://www.telerik.com/support/kb/wpf/window/radwindow-as-main-window.aspx 참조) –