2013-01-14 58 views
0

我開發WPF C#,雖然我跑我的申請,我得到這個錯誤: 這是我的代碼上「System.Windows.Baml2006.TypeConverterMarkupExtension」提供價值拋出一個異常

<Window x:Class="Hello.Testing" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:r="clr-namespace:Wpf.Controls;assembly=Wpf.TabControl" 
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" 
    xmlns:sys="clr-namespace:System;assembly=mscorlib" 
    Title="Testing" Height="780" Width="1024" WindowStartupLocation="CenterScreen" 
    MinWidth="1024" MinHeight="780" 
    WindowStyle="None" AllowsTransparency="False"   
    ResizeMode="CanResizeWithGrip" Icon="Resources/Images/Icons/small_icon.ico" Loaded="Window_Loaded"> 

這是一個我得到的錯誤: "Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception"

+0

您確定這是所有的代碼?這似乎不是一個完整的標籤,除非你打算用'/>'結束它 – mletterle

回答

0

似乎你正在使用有點標記擴展。 這個標記擴展是由你自己實現的嗎? 我記得自定義的MarkupExtension要求你實現一個成員方法ProvideValue,並且似乎是該棧上的異常。

0

當您在xaml中使用某些圖像(在您的案例中爲圖標)時,您有時會收到此錯誤,但忘記了包含在您的項目中。您必須從外部複製該目錄中的圖像,但尚未將其包含在您的項目中。

相關問題