예제 #1
0
        private void SelectChameleonTypeHyperlink_Click(object sender, RoutedEventArgs e)
        {
            if (sender == null) return;
            FrameworkElement element = ((Hyperlink)sender).Parent as FrameworkElement;
            ChameleonBox box = element.GetParent<ChameleonBox>();
            if (box == null) return;

            Confirmation confirmation = new Confirmation()
            {
                Title = "Выберите тип значения",
                Content = this.InfoBase
            };
            this.SelectDataTypeDialog.Raise(confirmation, response =>
            {
                if (response.Confirmed)
                {
                    this.OnDataTypeSelected(box, response.Content as Entity);
                }
                else
                {
                    DataGridCell cell = box.GetParent<DataGridCell>();
                    if (cell == null) return;
                    cell.IsEditing = false;
                }
            });
        }
예제 #2
0
 private void OnReferenceObjectSelected(ChameleonBox target, ReferenceProxy entity)
 {
     target.ChameleonValue = entity;
     target.ChameleonType = entity.Type;
     UpdateSourceObjectValue(target);
     
     DataGridCell cell = target.GetParent<DataGridCell>();
     if (cell == null) return;
     cell.IsEditing = false;
 }
예제 #3
0
        private void OnDataTypeSelected(ChameleonBox target, Entity type)
        {
            if (type == null || type == Entity.Empty) return;
            if (type.Code > 0)
            {
                OnSelectReferenceObject(target, type);
                return;
            }
            target.ChameleonValue = Entity.GetDefaultValue(type);
            UpdateSourceObjectValue(target);

            DataGridCell cell = target.GetParent<DataGridCell>();
            if (cell == null) return;
            cell.IsEditing = false;
        }
예제 #4
0
 private void OnSelectReferenceObject(ChameleonBox box, Entity type)
 {
     Confirmation confirmation = new Confirmation() { Title = string.Empty, Content = type };
     this.SelectReferenceObjectDialog.Raise(confirmation, response =>
     {
         if (response.Confirmed)
         {
             this.OnReferenceObjectSelected(box, response.Content as ReferenceProxy);
         }
         else
         {
             DataGridCell cell = box.GetParent<DataGridCell>();
             if (cell == null) return;
             cell.IsEditing = false;
         }
     });
 }