private void CellEditElement_SelectionChanged(object sender, SelectionChangedArg e, object dataContext)
        {
            if (internalChange)
            {
                return;
            }
            //فقط وقتی کاربر انتخاب میکند باید اینجا بیاد
            var property = dataContext.GetType().GetProperty(this.DataMemberBinding.Path.Path);

            if (property != null)
            {
                if (e.SelectedItem != null)
                {
                    var sourcevalueproperty = e.SelectedItem.GetType().GetProperty(this.SelectedValueMemberPath);
                    if (sourcevalueproperty != null)
                    {
                        //AppendToItemsSource(e.SelectedItem);
                        var value = sourcevalueproperty.GetValue(e.SelectedItem);
                        property.SetValue(dataContext, value);
                    }
                }
                else
                {
                    if (property.PropertyType == typeof(string))
                    {
                        property.SetValue(dataContext, null);
                    }
                    else if (MyBaseLookup.IsNumericType(property.PropertyType))
                    {
                        property.SetValue(dataContext, 0);
                    }
                }
            }
        }
 private void LokEntities_SelectionChanged(object sender, MyCommonWPFControls.SelectionChangedArg e)
 {
     if (lokEntities.SelectedItem == null)
     {
         tabForm.Visibility = Visibility.Collapsed;
     }
     else
     {
         tabForm.Visibility = Visibility.Visible;
         SetRelationshipTails();
     }
 }
        private void LokEntities_SelectionChanged(object sender, MyCommonWPFControls.SelectionChangedArg e)
        {
            SetEnityStates();
            if (lokEntities.SelectedItem != null)
            {
                //SetRelationshipTails();
                //SetColumns();
                //SetFromulas();

                GetDirectSecurity();
            }
            else
            {
                lokState.ItemsSource = null;
                txtDescription.Text  = "";
                //cmbColumns.ItemsSource = null;
                //lokRelationshipTail.ItemsSource = null;
                //lokFormula.ItemsSource = null;
            }
        }
示例#4
0
 private void LokRelationshipTail_SelectionChanged(object sender, MyCommonWPFControls.SelectionChangedArg e)
 {
     SetColumns();
 }