void DetailExecCancel() { _dataService.GetControlChannel(DetailSelectedItem.Id, (data, error) => { if (error != null) { return; } // Report error here DetailCurrentObject = data; }); DetailCurrentObject.Partitions = Partitions; DetailCurrentObject.Partition = Partitions.Find(p => p.Id == DetailSelectedItem.Partition.Id); DetailEditMode = false; MasterAddCmd.RaiseCanExecuteChanged(); MasterRemoveCmd.RaiseCanExecuteChanged(); DetailListCurtainVisibility = Visibility.Collapsed; MasterListCurtainVisibility = Visibility.Collapsed; DetailObjectCurtainVisibility = Visibility.Visible; DetailObjectButtonsVisibility = Visibility.Collapsed; MessengerInstance.Send("", AppContext.UnBlockUIMsg); }
void MasterExecAdd() { MasterAddMode = true; MasterCurrentObject = new LightZone(); MasterCurrentObject.PointType = PointTypeEnum.W; MasterCurrentObject.Partition = AppContext.Partition; MasterCurrentObject.ControlSpace = AppContext.ControlSpace; MasterCurrentObject.LE_ProxyList = new ObservableCollection <LE_Proxy>(); MasterAddCmd.RaiseCanExecuteChanged(); MasterRemoveCmd.RaiseCanExecuteChanged(); ViewCmd.RaiseCanExecuteChanged(); MasterObjectPanelVisibility = Visibility.Visible; MasterObjectButtonsVisibility = Visibility.Visible; MasterListCurtainVisibility = Visibility.Visible; DetailListCurtainVisibility = Visibility.Visible; MasterObjectCurtainVisibility = Visibility.Collapsed; ProxyListCurtainVisibility = Visibility.Visible; MessengerInstance.Send("", AppContext.BlockUIMsg); }
void DetailExecSave() { int updateCount = 0; _dataService.UpdateControlChannel(DetailCurrentObject, (data, error) => { if (error != null) { return; } // Report error here updateCount = data; }); DetailEditMode = false; MasterAddCmd.RaiseCanExecuteChanged(); MasterRemoveCmd.RaiseCanExecuteChanged(); //int i = DetailList.IndexOf(DetailSelectedItem); DetailList[dsix] = DetailCurrentObject; DetailSelectedItem = DetailCurrentObject; DetailObjectButtonsVisibility = Visibility.Collapsed; DetailListCurtainVisibility = Visibility.Collapsed; DetailObjectCurtainVisibility = Visibility.Visible; MasterListCurtainVisibility = Visibility.Collapsed; MessengerInstance.Send("", AppContext.UnBlockUIMsg); }
void MasterExecSave() { int i = -1; _dataService.UpdateLightZone(MasterCurrentObject, (updatedCount, error) => { if (error != null) { return; } // Report error here i = updatedCount; }); MasterObjectButtonsVisibility = Visibility.Collapsed; MasterListCurtainVisibility = Visibility.Collapsed; DetailListCurtainVisibility = Visibility.Collapsed; ProxyListCurtainVisibility = Visibility.Collapsed; if (MasterAddMode) { MasterList.Add(MasterCurrentObject); MasterSelectedItem = MasterCurrentObject; } // if (MasterEditMode) //in EditMode MasterSelectedItem always not null // { // if (!partitionChanged) // { // MasterList[msix] = MasterCurrentObject; // //MasterSelectedItem.RaiseIsLinkedChanged(); // MasterSelectedItem = MasterCurrentObject; // //if (savedDsix != -1) // // DetailSelectedItem = DetailList[savedDsix]; // } // else // { // MasterList.Remove(MasterSelectedItem); // //DetailContentVisibility = Visibility.Hidden; // partitionChanged = false; // } // } MasterAddMode = false; MasterEditMode = false; MasterRemoveCmd.RaiseCanExecuteChanged(); MasterAddCmd.RaiseCanExecuteChanged(); // //if (DetailSelectedItem != null) // //{ // // // при выполнении Save происходит замена .net объекта в MasterList // // // необходимо восстановить Visual State // // LightElement letmp = MasterSelectedItem; // // ControlChannel tmp = DetailSelectedItem; // // DetailSelectedItem = null; // // DetailSelectedItem = tmp; // // MasterSelectedItem = letmp; // //} //} MessengerInstance.Send("", AppContext.UnBlockUIMsg); }
//AttentionVM attentionVM; void MasterExecSave() { int i = -1; bool modeChanged = false; if (MasterCurrentObject.Mode != MasterCurrentObject.OldMode) { modeChanged = true; } _dataService.UpdateEventDevice(MasterCurrentObject, (updatedCount, error) => { if (error != null) { return; } // Report error here i = updatedCount; }); MasterObjectButtonsVisibility = Visibility.Collapsed; MasterListCurtainVisibility = Visibility.Collapsed; DetailListCurtainVisibility = Visibility.Collapsed; if (MasterAddMode) { MasterSelectorSelectedItem = null; MasterList.Add(MasterCurrentObject); MasterSelectedItem = MasterCurrentObject; MasterListVisibility = Visibility.Visible; } if (MasterEditMode) //in EditMode MasterSelectedItem always not null { MasterList[msix] = MasterCurrentObject; MasterSelectedItem = MasterCurrentObject; if (!modeChanged) { if (savedDsix != -1) { DetailSelectedItem = DetailList[savedDsix]; } } } MasterAddMode = false; MasterEditMode = false; MasterCurrentObject.IsEditMode = false; MasterCurrentObject.IsAddMode = false; MasterRemoveCmd.RaiseCanExecuteChanged(); MasterAddCmd.RaiseCanExecuteChanged(); MessengerInstance.Send("", AppContext.UnBlockUIMsg); }
void MasterExecCancel() { if (MasterEditMode) { _dataService.GetControlDevice(MasterSelectedItem.Id, (data, error) => { if (error != null) { return; } // Report error here MasterCurrentObject = data; }); } MasterAddMode = false; MasterEditMode = false; MasterCurrentObject.IsEditMode = false; MasterAddCmd.RaiseCanExecuteChanged(); MasterRemoveCmd.RaiseCanExecuteChanged(); MasterListCurtainVisibility = Visibility.Collapsed; MasterObjectCurtainVisibility = Visibility.Visible; DetailListCurtainVisibility = Visibility.Collapsed; MasterObjectButtonsVisibility = Visibility.Collapsed; MasterListVisibility = Visibility.Visible; if (MasterSelectedItem != null) { _dataService.GetControlDevice(MasterSelectedItem.Id, (data, error) => { if (error != null) { return; } // Report error here MasterCurrentObject = data; }); if (MasterSelectedItem.MultiChannel) { DetailContentVisibility = Visibility.Visible; if (DetailSelectedItem != null) { DetailObjectPanelVisibility = Visibility.Visible; } } } else { MasterObjectPanelVisibility = Visibility.Collapsed; } MessengerInstance.Send("", AppContext.UnBlockUIMsg); }
void DetailExecEdit() { DetailEditMode = true; DetailObjectCurtainVisibility = Visibility.Collapsed; DetailObjectButtonsVisibility = Visibility.Visible; DetailListCurtainVisibility = Visibility.Visible; MasterRemoveCmd.RaiseCanExecuteChanged(); MasterAddCmd.RaiseCanExecuteChanged(); MasterListCurtainVisibility = Visibility.Visible; MessengerInstance.Send("", AppContext.BlockUIMsg); }
void MasterExecEdit() { savedDsix = dsix; MasterEditMode = true; MasterCurrentObject.IsEditMode = true; MasterCurrentObject.Partitions = Partitions; MasterCurrentObject.Partition = Partitions.Find(p => p.Id == AppContext.Partition.Id); MasterAddCmd.RaiseCanExecuteChanged(); MasterRemoveCmd.RaiseCanExecuteChanged(); MasterListCurtainVisibility = Visibility.Visible; MasterObjectButtonsVisibility = Visibility.Visible; MasterObjectCurtainVisibility = Visibility.Collapsed; DetailListCurtainVisibility = Visibility.Visible; MessengerInstance.Send("", AppContext.BlockUIMsg); }
//AttentionVM attentionVM; void MasterExecSave() { int i = -1; bool partitionChanged = false; //int dsi = -1; if (MasterEditMode) { if (MasterCurrentObject.Partition.Id != MasterSelectedItem.Partition.Id) { partitionChanged = true; foreach (ControlChannel ch in MasterCurrentObject.ControlChannels) { ch.Partition = MasterCurrentObject.Partition; } } } _dataService.UpdateControlDevice(MasterCurrentObject, (updatedCount, error) => { if (error != null) { return; } // Report error here i = updatedCount; }); MasterObjectButtonsVisibility = Visibility.Collapsed; MasterListCurtainVisibility = Visibility.Collapsed; DetailListCurtainVisibility = Visibility.Collapsed; if (MasterAddMode) { MasterSelectorSelectedItem = null; MasterList.Add(MasterCurrentObject); MasterSelectedItem = MasterCurrentObject; MasterListVisibility = Visibility.Visible; } if (MasterEditMode) //in EditMode MasterSelectedItem always not null { if (!partitionChanged) { MasterList[msix] = MasterCurrentObject; MasterSelectedItem = MasterCurrentObject; if (savedDsix != -1) { DetailSelectedItem = DetailList[savedDsix]; } } else { MasterList.Remove(MasterSelectedItem); DetailContentVisibility = Visibility.Hidden; partitionChanged = false; } } MasterAddMode = false; MasterEditMode = false; MasterCurrentObject.IsEditMode = false; MasterRemoveCmd.RaiseCanExecuteChanged(); MasterAddCmd.RaiseCanExecuteChanged(); MessengerInstance.Send("", AppContext.UnBlockUIMsg); }