//override public void onRecieveResult(Dictionary <String, Object> bundle) { Object senderName; Object resultValue; Object senderValue; bundle.TryGetValue(PageDataExchange.KEY_SENDER_NAME, out senderName); bundle.TryGetValue(PageDataExchange.KEY_RESULT_VALUE, out resultValue); bundle.TryGetValue(PageDataExchange.KEY_SENDER_VALUE, out senderValue); //beckhoff changed if (WarnningDataSource.TAG.Equals(senderName)) { WarnningDataSource.ErrorInfo infoChanged = (WarnningDataSource.ErrorInfo)senderValue; WarnningDataSource.ErrorInfo infoCurrent = (WarnningDataSource.ErrorInfo) this.cb_info.SelectedItem; WarnningDataSource data = WarnningDataSource.GetInstance(); //if (data.IsWarnningAdded(infoChanged)) //{ // //this.cb_info.SelectedItem = infoChanged; //} //else if (infoCurrent != null && infoChanged.level == infoCurrent.level)// item was removed //{ // if (this.cb_info.SelectedIndex > 0) // { // this.cb_info.SelectedIndex = 0; // } //} PageDataExchange context = PageDataExchange.getInstance(); WarnningDataSource dataSource = WarnningDataSource.GetInstance(); if (dataSource.GetWarnningCount() == 0 && context.IsPageLoaded(PageWarningDetail.TAG)) { Utils.NavigatePageBack(); } this.cb_info.ItemsSource = data.GetWarnningList(); this.cb_info.Items.Refresh(); this.cb_info.SelectedIndex = 0; } }
public static void NavigateToPage(String panelName, String pageName, Boolean isStacked) { PageDataExchange context = PageDataExchange.getInstance(); if (context.IsPageLoaded(pageName)) { //prtocal.navigateToPage(panelName, pageName); return; } IProtocal prtocal = MainWindow.getProtocalInstance(); prtocal.navigateToPage(panelName, pageName); if (sPageNameMaps == null) { InitPageNamePathMaps(); } String path; sPageNameMaps.TryGetValue(pageName, out path); if (path != null) { context.CommandObserver(PageStatus.TAG, PageStatus.PATH, path); } if (panelName.Equals(MainWindow.sFrameReportName)) { if (isStacked && !String.IsNullOrEmpty(sCurrentPath)) { if (ToolbarParameter.sBackPageStack.Count == 0) { ToolbarParameter.sBackPageStack.Push(sCurrentPath); } else if (!sCurrentPath.Equals(ToolbarParameter.sBackPageStack.Peek())) { ToolbarParameter.sBackPageStack.Push(sCurrentPath); } } sCurrentPath = pageName; } }