private void InitializeCommand() { CommandBinding cbModelInit = new CommandBinding(cmdModelInit, cbModelInit_Executed, (sender, e) => { e.CanExecute = true; e.Handled = true; }); CommandBinding cbOnElementClassify = new CommandBinding(cmdOnElementClassify, (sender, e) => { if (bnOnElementClassify.IsChecked == true) { return; } if (Global.DocContent.CurrentZoneInfo.ZoneIndex == 0) { CurrentZoneLevel = Global.DocContent.CurrentZoneInfo.ZoneLevel = 1; CurrentZoneDirection = Global.DocContent.CurrentZoneInfo.ZoneDirection = "S"; CurrentZoneSystem = Global.DocContent.CurrentZoneInfo.ZoneSystem = "A"; CurrentZoneIndex = Global.DocContent.CurrentZoneInfo.ZoneIndex = 1; CurrentZoneCode = Global.DocContent.CurrentZoneInfo.ZoneCode = "Z-00-01-SA-01"; } else { CurrentZoneLevel = Global.DocContent.CurrentZoneInfo.ZoneLevel; CurrentZoneDirection = Global.DocContent.CurrentZoneInfo.ZoneDirection; CurrentZoneSystem = Global.DocContent.CurrentZoneInfo.ZoneSystem; CurrentZoneIndex = Global.DocContent.CurrentZoneInfo.ZoneIndex; CurrentZoneCode = Global.DocContent.CurrentZoneInfo.ZoneCode; } }, (sender, e) => { e.CanExecute = true; e.Handled = true; }); CommandBinding cbElementClassify = new CommandBinding(cmdElementClassify, cbElementClassify_Executed, (sender, e) => { e.CanExecute = true; e.Handled = true; }); CommandBinding cbElementLink = new CommandBinding(cmdElementLink, (sender, e) => { Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog() { Multiselect = true, InitialDirectory = System.IO.Path.GetDirectoryName(Global.DataFile), DefaultExt = "*.elist", Filter = "Element Collection Files(*.elist)|*.elist|All(*.*)|*.*" }; if (ofd.ShowDialog() == true) { ZoneHelper.FnLinkedElementsDeserialize(ofd.FileNames); bnElementResolve.SetResourceReference(ContentControl.TagProperty, "IconMassSort"); bnElementLink.Foreground = new SolidColorBrush(Colors.DarkGreen); listInformation.SelectedIndex = listInformation.Items.Add($"{DateTime.Now:HH:mm:ss} - LINK: FILE, {string.Join(",", ofd.SafeFileNames)}."); }