<Fluent:RibbonWindow x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Fluent="urn:fluent-ribbon"
xmlns:Data="clr-namespace:DispatchData;assembly=DispatchData"
xmlns:self="clr-namespace:DispatchWPF2"
mc:Ignorable="d"
Title="Dispatch Desktop" Height="600" Width="1000" Icon="Images/app1.png">
<Grid Grid.Row="1" ShowGridLines="False">
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="175"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TreeView Grid.Column="0" x:Name="DataTree" MinWidth="175" BorderThickness="0">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type self:DispatchTreeTerritoryItem}" ItemsSource="{Binding ClientLocations}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" />
</StackPanel>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type self:DispatchTreeClientLocationItem}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding ClientName,StringFormat='({0}) '}" />
<TextBlock Text="{Binding Address}" />
</StackPanel>
</DataTemplate>
</TreeView.Resources>
</TreeView>
</Grid>
</Fluent:RibbonWindow>我在错误列表窗口中得到以下错误..。
名称"DispatchTreeTerritoryItem“不存在于名称空间”clr-命名空间:DispatchWPF2 2“中。
这个错误带我到XAML,TreeView,HierarchicalDataTemplate -在DataType="{x:Type下有蓝色的小块。我知道DispatchTreeTerritoryItem类存在于DispatchWPF2命名空间中。
这将显示为错误窗口中的错误,但它不会阻止编译或运行应用程序。在运行时,一切看起来都和预期的一样。我看到treeview和我所期望的一样,装载了我所期望的数据。
不幸的是,此错误阻止了XAML设计器在Visual 2017中的显示。“设计图面”更改为带有“无效标记”字样的灰色框。我有点以视觉为导向,所以这对我来说很烦人。

对如何使这个错误消失并将我的设计图返回给我有什么想法吗?
发布于 2017-09-03 00:06:39
重新启动似乎解决了这个问题。
https://stackoverflow.com/questions/46011739
复制相似问题