zoukankan      html  css  js  c++  java
  • WPF : UserControl的Initialized事件不会触发

    UserControl必须实现ISupportInitialize接口.

    /// <summary>
    /// Implement ISupportInitialize so that the Initialized event can be attached in XAML.
    /// A known bug is that the BeginInit/EndInit will be called twice in WPF 3.*.
    /// </summary>

    public partial class UcTaskItemNote : ISupportInitialize
    {
        
    private int mInitCalledCount = 0;

        
    #region ISupportInitialize Members

        
    void ISupportInitialize.BeginInit()
        {       
            
    if(this.mInitCalledCount == 0)
            {
                
    return;
            }
            
    base.BeginInit();
        }

        
    void ISupportInitialize.EndInit()
        {
            
    if (this.mInitCalledCount == 0)
            {
                
    this.mInitCalledCount++;
                
    return;
            }
            
    base.EndInit();
        }

        
    #endregion
    }
  • 相关阅读:
    HTML5 WEB SQL
    Android-day04
    Android-day03
    Android-day02
    Android-day01
    java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
    事务管理、整合Junit、整合Web、SSH整合
    AOP、AspectJ、JdbcTemplate
    Spring基础
    Hibernate对连接池的支持
  • 原文地址:https://www.cnblogs.com/mrfangzheng/p/1610121.html
Copyright © 2011-2022 走看看