void windowRequests_WindowLoaded_PartNoFilter(object sender, EventArgs e) { PartWithNotify partWithNotify = (PartWithNotify)View.CurrentItem; WindowRequests windowRequests = (WindowRequests)sender; windowRequests.FilterPartNo(partWithNotify.PartNo); }
private void MenuItemFilterByPartNoOriginal_OnClick(object sender, RadRoutedEventArgs e) { if (View.CurrentItem == null) { return; } PartWithNotify partWithNotify = (PartWithNotify)View.CurrentItem; if (string.IsNullOrEmpty(partWithNotify.PartNoOrignal)) { return; } bool isWindowRequestOpen = false; WindowRequests windowRequests = null; foreach (var window in Application.Current.Windows) { if (window.GetType() == typeof(WindowRequests)) { isWindowRequestOpen = true; windowRequests = (WindowRequests)window; windowRequests.FilterPartNo(partWithNotify.PartNo); windowRequests.Activate(); break; } } if (isWindowRequestOpen == false) { windowRequests = new WindowRequests(); windowRequests.WindowLoaded += windowRequests_WindowLoaded_FilterPartNoOriginal; windowRequests.Show(); } }