Exemple #1
0
        private static void PlaceChangedCallBack(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            FreqAssignHandleControl freqassign = d as FreqAssignHandleControl;

            freqassign.querycondition.PlaceGuid = e.NewValue == null ? null : e.NewValue.ToString();
            freqassign.GetEquipmentInfos();
            freqassign.QueryRoundStations(e.NewValue.ToString());
        }
        private void listBoxStationPlanningStep_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems == null || e.AddedItems.Count == 0)
            {
                this.borderContent.Visibility = System.Windows.Visibility.Collapsed;
                return;
            }
            this.borderContent.Child      = null;
            this.borderContent.Visibility = System.Windows.Visibility.Visible;
            var stepState = e.AddedItems[0] as FreqPlanningStepState;

            if (stepState != null)
            {
                switch (stepState.Step)
                {
                case Types.FreqPlanningStep.FreqAssign:
                    FreqAssignHandleControl freqAssignHandle = new FreqAssignHandleControl();
                    freqAssignHandle.PlaceGuid = this.CurrentPlaceGuid;
                    this.borderContent.Child   = freqAssignHandle;
                    break;

                case Types.FreqPlanningStep.EquipmentInspection:
                    EquCheckControl equCheckControl = new EquCheckControl();
                    equCheckControl.PlaceGuid = this.CurrentPlaceGuid;
                    this.borderContent.Child  = equCheckControl;
                    break;

                default:
                    this.borderContent.Visibility = System.Windows.Visibility.Collapsed;
                    break;
                }
            }



            //this.borderContent.Child = null;
            //this.borderContent.Visibility = System.Windows.Visibility.Visible;
            //switch (listBoxStationPlanningStep.SelectedIndex)
            //{
            //    case 0:
            //        FreqAssignHandleControl freqAssignHandle = new FreqAssignHandleControl();
            //        freqAssignHandle.PlaceGuid = this.CurrentPlaceGuid;
            //        this.borderContent.Child = freqAssignHandle;
            //        break;
            //    case 1:
            //        EquCheckControl equCheckControl = new EquCheckControl();
            //        equCheckControl.PlaceGuid = this.CurrentPlaceGuid;
            //        this.borderContent.Child = equCheckControl;
            //        break;
            //}
        }