App.xaml.cs에 값 변환기를 추가하지만 한 번 더 추가하면 응용 프로그램 시작시 예외가 발생합니다. 다루다. 그것은 App.gics에 있습니다App.xaml.cs에 너무 많은 값 변환기를 등록하면 충돌이 발생합니다.
예외 : 여기
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException += (sender, e) =>
{
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
};
#endif
이 App.xaml.cs를
<Application x:Class="cMC.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:myApp">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Assets/ResourceDictionaries/ResrcDict1.xaml" />
<ResourceDictionary Source="/DataTemplates/DataTemplates.xaml" />
</ResourceDictionary.MergedDictionaries>
<vm:ViewModelLocator x:Key="Locator" xmlns:vm="using:myApp.ViewModel" />
<ic:InverseBooleanConverter x:Key="InverseBoolToVisibility" xmlns:ic="using:myApp.Helpers"/>
<mc:SegmentPartWrapper x:Key="SegmentPartWrapper" xmlns:mc="using:myApp.ViewModel"/>
<mc:SegmentDateCNVRTR x:Key="SegmentDateCNVRTR" xmlns:mc="using:myApp.ViewModel"/>
<mc:RailIconBooleanConverter x:Key="RailIconBooleanConverter" xmlns:mc="using:myApp.ViewModel"/>
<mc:CarIconBooleanConverter x:Key="CarIconBooleanConverter" xmlns:mc="using:myApp.ViewModel"/>
</ResourceDictionary>
내 컨버터입니다이 하나가 원인 문제는 "CarIconBooleanConverter"이지만 ViewModel의 코드는 "RailIconBooleanConverter"와 동일합니다.
<mc:CarIconBooleanConverter x:Key="CarIconBooleanConverter" xmlns:mc="using:myApp.ViewModel"/>
는 편집 :
나는 잘 작동 App.xaml.cs를하고 "CarIconBooleanConverter"에서 다른 컨버터 중 하나를 제거했다. 컨버터가 너무 많기 때문에 그렇습니까?
"너무 많은 변환기"를 등록 했으므로 예외가 발생합니까? 다른 변환기를 제거한 다음'CarIconBooleanConverter'을 추가하면 작동합니까? 또한 예외 사항에 대해 자세히 설명해 주시겠습니까? –
KooKiz, 방금 다른 사람 중 한 명에게 댓글을 달았습니다. 아무런 문제가 없습니다. 실제로 너무 많은 변환기가 있기 때문에 가능합니까? –
예외 메시지를 게시 할 수 있습니까? 당신이 게시 한 것은 예외는 아니며 단지 처리기 메서드 일뿐입니다.) 또한 변환기에서 코드를 게시하십시오. – Fred