zoukankan      html  css  js  c++  java
  • 一个“>”导致我调试了1个小时才解决问题

    在XAML里面写了如下的代码:

        <DataTemplate x:Key="DT_HintCategory">
          <Expander HorizontalContentAlignment="Stretch"
                          ExpandDirection="Down"
                          Expanded="Expander_Expanded"
                          Header="AAA"
                          IsExpanded="{Binding Path=IsExpanded,
                                               Mode=TwoWay}">
            <Expander.Content>
              <ListBox x:Name="PART_HINTS" IsSynchronizedWithCurrentItem="False">>
                <ListBox.ItemsSource>
                  <PriorityBinding>
                    <Binding Path="HintsSlow" IsAsync="True" />
                    <Binding Path="HintsFast" IsAsync="False" />
                  </PriorityBinding>
                </ListBox.ItemsSource>
                <ListBox.ItemTemplate>
                  <DataTemplate>
                    <StackPanel>
                      <TextBlock Text="{Binding Name}" />
                    </StackPanel>
                  </DataTemplate>
                </ListBox.ItemTemplate>
              </ListBox>
            </Expander.Content>
          </Expander>
        </DataTemplate>


    原因就是: <ListBox x:Name="PART_HINTS" IsSynchronizedWithCurrentItem="False">>(多写了一个大于号!)

    结果在设计界面显示:An Unhandled Exception has occured: Click here to reload the designer.

    在调试过程中,报: 

    {"Add value to collection of type 'System.Windows.Controls.ItemCollection' threw an exception."}

    Inner Exception: {"Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead."}

     

  • 相关阅读:
    js-AOP
    jQueryUI之autocomplete
    nginx安装配置
    oracle结构语法
    ajax/表单提交 多个相同name的处理方法
    ES6模块化
    docker运维
    帆软报表
    oracle锁表
    香港到大陆IPLC节点故障
  • 原文地址:https://www.cnblogs.com/puncha/p/3877000.html
Copyright © 2011-2022 走看看