2010-06-01 5 views
5

Tôi đã lồng lớpXAML lồng lớp thiết kế con đường vấn đề

public class Enums 
{ 
    public enum WindowModeEnum { Edit, New } 
} 

Trong XAML của tôi, tôi tham khảo mã:

<Style.Triggers> 
    <DataTrigger Binding="{Binding WindowMode}" 
     Value="{x:Static Types1:Enums+WindowModeEnum.Edit}"> 
      <Setter Property="Visibility" 
        Value="Collapsed" /> 
    </DataTrigger> 
</Style.Triggers> 

Mã biên dịch và chạy đúng, tuy nhiên tôi không thể mã XAML mở trong thiết kế cửa sổ. Tôi gặp phải lỗi sau:

Type 'Types1:Enums+WindowModeEnum' was not found. 
    at MS.Internal.Metadata.ExposedTypes.ValueSerializers.StaticMemberDocumentValueSerializer.ConvertToDocumentValue(ITypeMetadata type, String value, IServiceProvider documentServices) 
    at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlMarkupExtensionPropertyBase.get_Value() 
    at MS.Internal.Design.DocumentModel.DocumentTrees.DocumentPropertyWrapper.get_Value() 
    at MS.Internal.Design.DocumentModel.DocumentTrees.InMemory.InMemoryDocumentProperty..ctor(DocumentProperty property, InMemoryDocumentItem item) 
    at MS.Internal.Design.DocumentModel.DocumentTrees.InMemory.InMemoryDocumentItem.SetUpItem(DocumentItem item) 

Lỗi tương tự tồn tại trong VS2008, VS2010.

Có ai có ý tưởng hay không, cách xử lý nó để tôi có thể mở cửa sổ ở chế độ thiết kế.

Cảm ơn rất nhiều.

Trân trọng, Vlad.

Trả lời

2

Tôi đã đặt cùng một câu hỏi cho Microsoft và họ cũng đã thử nghiệm kịch bản này và họ thừa nhận rằng đây là lỗi trên mặt của họ và họ sẽ xem xét nó.

+0

Đây là liên kết Microsoft Connect với lỗi: http://connect.microsoft.com/VisualStudio/feedback/details/361509/xaml-designer-cannot-handle-typename-with-nested-classes – cplotts