DesignData를 사용하여 디자인 타임에 ItemsControl을 채려고합니다.d : DesignData FileNotFoundException
/DesignData/SampleAlerts.xaml이 파일의 내용 :
<ext:AlertSource 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"
xmlns:ext="http://schemas.osterwalder.com/extensions"
mc:Ignorable="d" d:IsDataSource="true" Guid="4D0E0886-575C-42F2-A777-2A36AB826D14" Name="Sample Alerts">
<ext:AlertSource.Alerts>
<ext:AlertBase Cause="sdlfkhjsdlkfj" Id="0" IsActive="True" IsAutoReset="False" IsOwnerAlive="False" Message="skdjfhsdakjhf" Removal="skjfdhkjsdfhs" Severity="SystemFault" Source="{x:Null}"/>
<ext:AlertBase Cause="sdlfkhjsdlkfj" Id="0" IsActive="True" IsAutoReset="False" IsOwnerAlive="False" Message="skdjfhsdakjhf" Removal="skjfdhkjsdfhs" Severity="EmergencyStop" Source="{x:Null}"/>
<ext:AlertBase Cause="sdlfkhjsdlkfj" Id="0" IsActive="True" IsAutoReset="False" IsOwnerAlive="False" Message="skdjfhsdakjhf" Removal="skjfdhkjsdfhs" Severity="ImmediateStop" Source="{x:Null}"/>
<ext:AlertBase Cause="sdlfkhjsdlkfj" Id="0" IsActive="True" IsAutoReset="False" IsOwnerAlive="False" Message="skdjfhsdakjhf" Removal="skjfdhkjsdfhs" Severity="CycleStop" Source="{x:Null}"/>
<ext:AlertBase Cause="sdlfkhjsdlkfj" Id="0" IsActive="True" IsAutoReset="False" IsOwnerAlive="False" Message="skdjfhsdakjhf" Removal="skjfdhkjsdfhs" Severity="Warning" Source="{x:Null}"/>
</ext:AlertSource.Alerts>
그리고 /DesignData/SampleAlerts.xaml이 DesignData로 설정 파일의 빌드 작업입니다. 모든 것이 잘 구축
<CollectionViewSource x:Key="AlertGroups"
mc:Ignorable="d" d:DesignSource="{d:DesignData Source=/DesignData/SampleAlerts.xaml}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="Severity"/>
</CollectionViewSource.GroupDescriptions>
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="Severity" Direction="Descending"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
으로 VisualStudio에서,하지만 난 비주얼 스튜디오 디자이너에서 다음과 같은 예외가 얻을 : 또한
The resource 'file:///C:/Users/reto/Documents/Visual Studio 2010/Projects/PPS/HMI/DesignData/SampleAlerts.xaml#3' could not be found. It should be located at 'C:\Users\reto\Documents\Visual Studio 2010\Projects\PPS\HMI\DesignData\SampleAlerts.xaml#3' but the file is not present.
at MS.Internal.Providers.VSExternalResourceProvider.GetTextModel(String uri, FileModel relativeTo)
at MS.Internal.Host.Isolation.Adapters.ContextToProtocolAdapter.MS.Internal.Host.Isolation.Protocols.IExternalResourceProtocol.GetTextModel(String uri, IFileModel relativeTo)
at MS.Internal.Host.Isolation.Protocols.IExternalResourceProtocol.GetTextModel(String uri, IFileModel relativeTo)
at MS.Internal.Host.Isolation.Adapters.ToExternalResourceAdapter.GetTextModel(String uri, FileModel relativeTo)
at MS.Internal.Host.MarkupProjectContext.GetMarkupResourceImpl(Uri uri)
at MS.Internal.Host.MarkupProjectContext.GetMarkupResource(Uri uri)
at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.TreeChangeListener.Microsoft.Windows.Design.DocumentModel.IDocumentTreeConsumer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args)
at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.CancelableDocumentTreeCoordinator.RouteMessage[T](IDocumentTreeConsumer consumer, MessageKey`1 key, T args)
at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args, Boolean isPrivateMessage)
at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args)
at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.QueryValue[TResult,TParameter](QueryKey`2 key, IDocumentTreeConsumer consumer, TParameter parameter)
at Microsoft.Windows.Design.Platform.ViewProducerBase.MS.Internal.Platform.IResourceResolver.GetMarkupResource(Uri uri)
at MS.Internal.Platform.CiderProjectContext.ResolveMarkupResource(Uri uri, Func`2 fallbackResolver)
at Microsoft.Windows.Design.Platform.ViewProducerBase.GetExternalView(String path)
at Microsoft.Windows.Design.Platform.ViewProducerBase.Microsoft.Expression.DesignModel.DocumentModel.IDocumentRootResolver.GetDocumentRoot(String path)
at Microsoft.Expression.DesignModel.InstanceBuilders.DesignDataInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.Expression.DesignModel.Core.ViewNodeManager.Instantiate(ViewNode viewNode)
과
내가 UI에서이 설계 데이터를 사용하려고
블렌드 eveything 잘 빌드하지만 디자이너가 다음과 같은 오류를 보여줍니다. - 형식 'AlertSource'추상 및 명시 적 값이 있어야합니다. Ln 1 Col 0 - 회원 '경고'가 인식되지 않거나 액세스 할 수 없습니다.public abstract class AlertBase : IAlert
{
public long Id { get { ... } }
public abstract object Message { get; }
public abstract object GetLocalizedMessage(CultureInfo culture);
public abstract object Cause { get; }
public abstract object GetLocalizedCause(CultureInfo culture);
public abstract object Removal { get; }
public abstract object GetLocalizedRemoval(CultureInfo culture);
public AlertSource Source { get { ... } }
AlertSource IAlert.Source { get { ... } }
public bool IsOwnerAlive { get { ... } }
public bool IsActive { get { ... } set { ... } }
public abstract bool IsAutoReset { get; }
public abstract AlertSeverity Severity { get; }
public void Acknowledge() { ... }
public AlertBase(long id, AlertSource owner) { ... }
public event EventHandler Set;
public event EventHandler Reset;
public event EventHandler Acknowledged;
}
및
이public abstract class AlertSource : IAlertSource
{
public abstract Guid Guid { get; }
public abstract string Name { get; }
public ICollection<IAlert> Alerts { get { ... } }
public AlertSource() { ... }
public virtual bool Acknowledge(IAlert alert) { ... }
public event NotifyCollectionChangedEventHandler CollectionChanged;
public event EventHandler AlertSet;
public event EventHandler AlertReset;
public event EventHandler AlertAcknowledged;
public IEnumerator<IAlert> GetEnumerator() { ... }
IEnumerator IEnumerable.GetEnumerator() { ... }
}
누군가가이 문제를 해결하는 방법을 알고 있나요 : 골 4
타입 AlertSource 및 AlertBase 7 속에는 다음과 같은 skelettons와 추상 클래스는?