/// <summary>
        /// Creates a new <see cref="BaseFileDialog" />.
        /// </summary>
        public BaseFileDialog()
            : base()
        {
            m_fileControl = null;

            Loaded   += LoadedHandler;
            Unloaded += UnloadedHandler;
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (m_fileControl != null)
            {
                m_fileControl.Cancel       -= CancelHandler;
                m_fileControl.FileSelected -= OpenDirectoryControlFileSelectedHandler;
            }

            m_fileControl = Template.FindName(FileControlName, this) as BaseFileControl;
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            m_fileControl = Template.FindName(FileControlName, this) as BaseFileControl;
        }