2
<UserControl x:Class="NodeBrowser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="344" d:DesignWidth="589"
d:DataContext="{d:DesignInstance Type=local:NodeBrowserViewModel, IsDesignTimeCreatable=True}"
>
<Whatever...>
</UserControl>
내 디자인 인스턴스가 처음으로 나는 그래서 데이터베이스에 대한 연결을 생성합니다 ... 다음과 같은 마크 업에 의해 생성 된 오브젝트를 처리 할 수있는 방법이 있나요 디자인 타임 테스트는이 모든 것이 잘 작동하지만 첫 번째 디자인 타임 데이터에는 여전히 열린 연결이 있기 때문에 두 번째로 예외가 발생합니다.
이제는 이것이 의미가 없지만 d : DesignInstance를 통해 만들어진 개체가 IDisposable을 구현하더라도 처리되지 않는 것으로 보입니다.
이 문제에 대한 해결책이 있습니까? 아니면 기본적으로 설계 데이터에 IDisposable을 요구하지 않는 경량의 물체를 제공해야합니까?