void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.dd = ((FileExplorer.WPF.BaseControls.DropDown)(target)); return; case 2: this.DirectoryTree = ((FileExplorer.WPF.Views.DirectoryTreeView)(target)); return; } this._contentLoaded = true; }
private static object OnIsDropDownOpenCoerce(DependencyObject sender, object baseValue) { DropDown ddc = (DropDown)sender; if ((bool)baseValue) { if (Math.Abs(ddc.lastLostFocusTime.Subtract(DateTime.UtcNow).TotalSeconds) < 0.5) { return(false); } } else { ddc.lastLostFocusTime = DateTime.UtcNow; } return(baseValue); }