当前位置: 首页>>代码示例>>C#>>正文


C# BindingMode类代码示例

本文整理汇总了C#中BindingMode的典型用法代码示例。如果您正苦于以下问题:C# BindingMode类的具体用法?C# BindingMode怎么用?C# BindingMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BindingMode类属于命名空间,在下文中一共展示了BindingMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetBindingObject

        public static void SetBindingObject(FrameworkElement obj, BindingMode mode, object source, DependencyProperty dp, string propertyName)
        {
            Type propertyType = source.GetType().GetProperty(propertyName).PropertyType;
            PropertyInfo info = source.GetType().GetProperty("RangeList");
            FANumberRangeRule rangeRule = null;
            if (info != null)
            {
                object value = info.GetValue(source, null);
                if (value != null)
                {
                    FALibrary.Utility.SerializableDictionary<string, FARange> dic =
                        (FALibrary.Utility.SerializableDictionary<string, FARange>)value;
                    if (dic.ContainsKey(propertyName))
                    {
                        rangeRule = new FANumberRangeRule(propertyType);
                        rangeRule.Range = dic[propertyName];
                        obj.Tag = rangeRule;
                        obj.Style = (Style)App.Current.Resources["TextBoxErrorStyle"];
                    }
                }
            }

            Binding bd = new Binding(propertyName);
            bd.Source = source;
            bd.Mode = mode;
            bd.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            if (rangeRule != null)
            {
                bd.NotifyOnValidationError = true;
                bd.ValidationRules.Add(rangeRule);
            }

            obj.SetBinding(dp, bd);
        }
开发者ID:vesteksoftware,项目名称:VT8642,代码行数:34,代码来源:BindingUtility.cs

示例2: SetBinding

 public static BindingExpressionBase SetBinding(this FrameworkElement target, DependencyProperty dp, object source, string path, BindingMode bindingMode)
 {
     Binding b = new Binding(path);
     b.Source = source;
     b.Mode = bindingMode;
     return BindingOperations.SetBinding(target, dp, b);
 }
开发者ID:saykorz,项目名称:LunarBase,代码行数:7,代码来源:BindingExtensions.cs

示例3: XamlBindingDefinition

 public XamlBindingDefinition(Control target, PerspexProperty targetProperty, PropertyPath sourcePropertyPath, BindingMode bindingMode)
 {
     this.target = target;
     this.targetProperty = targetProperty;
     this.sourcePropertyPath = sourcePropertyPath;
     this.bindingMode = bindingMode;
 }
开发者ID:Scellow,项目名称:Perspex,代码行数:7,代码来源:XamlBindingDefinition.cs

示例4: BindingExpression

 public BindingExpression(BindingMode mode, Binding.Parsing.Expressions.BindingPathExpression path, RedwoodProperty sourceProperty = null, RedwoodBindable source = null)
 {
     Path = path;
     Mode = mode;
     SourceProperty = sourceProperty ?? Controls.RedwoodControl.DataContextProperty;
     Source = source;
 }
开发者ID:jechtom,项目名称:Redwood,代码行数:7,代码来源:BindingExpression.cs

示例5: DenomTemplateColumnDefinition

 public DenomTemplateColumnDefinition(string columnName, string displayMember, string headerName, DenomColumnDataType columnDataType = DenomColumnDataType.Text, string alignment = "left", string width = "auto", bool isEditable = false, bool calculationRequired = false, string formula = "", string calculationOn = "", bool totalRequired = false, string footerText = "", bool isReadOnly = false, bool isVisible = true, bool allowDecimal = false, bool allowNegativeValue = false, bool spinnerRequired = false, string seed = "1", int decimalPlaces = 0, bool currencySymbolRequired = false, CurrencySymbolPositionType currencySymbolPosition= CurrencySymbolPositionType.Header, BindingMode bindingType= BindingMode.OneWay)
 {
     this.ColumnName = columnName;
     this.DisplayMember = displayMember;
     this.Width = width;
     this.ColumnDataType = columnDataType;
     this.Alignment = alignment;
     this.HeaderName = headerName;
     this.IsEditable = isEditable;
     this.CalculationRequired = calculationRequired;
     this.Formula = formula;
     this.CalculationOn= calculationOn;
     this.TotalRequired = totalRequired;
     this.FooterText = footerText;
     this.IsReadOnly = isReadOnly;
     this.IsVisible = isVisible;
     this.AllowDecimal = allowDecimal;
     this.AllowNegativeValue = allowNegativeValue;
     this.SpinnerRequired = spinnerRequired;
     this.Seed = seed;
     this.DecimalPlaces = decimalPlaces;
     this.CurrencySymbolRequired = currencySymbolRequired;
     this.CurrencySymbolPosition = currencySymbolPosition;
     this.BindingType = bindingType;
 }
开发者ID:krishnarajv,项目名称:Code,代码行数:25,代码来源:DenomTemplateColumnDefinition.cs

示例6: XamlBindingDefinition

 public XamlBindingDefinition(Control target, PerspexProperty targetProperty, PropertyPath sourcePropertyPath, BindingMode bindingMode)
 {
     _target = target;
     _targetProperty = targetProperty;
     _sourcePropertyPath = sourcePropertyPath;
     _bindingMode = bindingMode;
 }
开发者ID:healtech,项目名称:Perspex,代码行数:7,代码来源:XamlBindingDefinition.cs

示例7: BindParameter

        private static void BindParameter(FrameworkElement target, Parameter parameter, string elementName, string path, BindingMode bindingMode)
        {
            var element = elementName == "$this"
                ? target
                : ExtensionMethods.GetNamedElementsInScope(target).FindName(elementName);
            if (element == null)
                return;

            if(string.IsNullOrEmpty(path))
                path = ConventionManager.GetElementConvention(element.GetType()).ParameterProperty;

            var binding = new Binding(path) {
                Source = element,
                Mode = bindingMode
            };

            #if SILVERLIGHT
            var expression = (BindingExpression)BindingOperations.SetBinding(parameter, Parameter.ValueProperty, binding);

            var field = element.GetType().GetField(path + "Property", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
            if (field == null)
                return;

            ConventionManager.ApplySilverlightTriggers(element, (DependencyProperty)field.GetValue(null), x => expression);
            #else
            binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            BindingOperations.SetBinding(parameter, Parameter.ValueProperty, binding);
            #endif
        }
开发者ID:e-tobi,项目名称:Caliburn-Micro-Mirror,代码行数:29,代码来源:Parser.cs

示例8: SetBindingObject

 public static void SetBindingObject(FrameworkElement obj, BindingMode mode, object source, DependencyProperty dp, string propertyName)
 {
     Binding bd = new Binding(propertyName);
     bd.Source = source;
     bd.Mode = mode;
     obj.SetBinding(dp, bd);
 }
开发者ID:vesteksoftware,项目名称:Onyang_CL_CSharp_VT5081,代码行数:7,代码来源:BindingUtility.cs

示例9: Binder

 protected Binder(IChangable source, IChangable target, BindingMode mode)
 {
     _source = source;
     _target = target;
     _sourceIsUsed = mode == BindingMode.OneWay || mode == BindingMode.TwoWay;
     _targetIsUsed = mode == BindingMode.OneWayToSource || mode == BindingMode.TwoWay;
 }
开发者ID:li5414,项目名称:uBinding,代码行数:7,代码来源:Binder.cs

示例10: XamlBindingDefinition

 public XamlBindingDefinition(
     string sourcePropertyPath, 
     BindingMode bindingMode)
 {
     SourcePropertyPath = sourcePropertyPath;
     BindingMode = bindingMode;
 }
开发者ID:rdterner,项目名称:Perspex,代码行数:7,代码来源:XamlBindingDefinition.cs

示例11: BindProperty

 public static void BindProperty(Control control, object source, string path,
     DependencyProperty property, BindingMode mode)
 {
     var binding = new Binding(path);
     binding.Source = source;
     binding.Mode = mode;
     control.SetBinding(property, binding);
 }
开发者ID:kondoumh,项目名称:iedit-silverlight,代码行数:8,代码来源:BindingFuntions.cs

示例12: UnitTestSettings

 public UnitTestSettings(BindingMode bindingMode, AssertMode assertMode, bool moduleInit, bool methodInit, bool defaultTestStub)
 {
     BindingMode = bindingMode;
     AssertMode = assertMode;
     ModuleInit = moduleInit;
     MethodInit = methodInit;
     DefaultTestStubInNewModule = defaultTestStub;
 }
开发者ID:retailcoder,项目名称:Rubberduck,代码行数:8,代码来源:UnitTestSettings.cs

示例13: BindingInfo

 /// <summary>
 /// Initializes a new BindingInfo with a path, a source binding RelativeSourceMode, and an optional converter. 
 /// </summary>
 /// <param name="path">The path to the source member.</param>
 /// <param name="bindingMode">The binding direction.</param>
 /// <param name="relativeSourceMode">The source RelativeSourceMode.</param>
 /// <param name="converterType">An optional converter.</param>
 /// <param name="converterParameter">An optional converter parameter.</param>
 internal BindingInfo(string path, BindingMode bindingMode, RelativeSourceMode relativeSourceMode, Type converterType = null,
     object converterParameter = null)
 {
     Path = path;
     RelativeSourceMode = relativeSourceMode;
     ConverterType = converterType;
     ConverterParameter = converterParameter;
 }
开发者ID:andyvans,项目名称:BinarySerializer,代码行数:16,代码来源:BindingInfo.cs

示例14: Add

 /// <summary>
 /// バインディングを追加します。
 /// </summary>
 public Binding Add(object bindableTarget, string bindingPropertyName,
                    object dataSource, string dataSourcePropertyName,
                    BindingMode mode, string format = null)
 {
     return Add(
         bindableTarget, bindingPropertyName,
         dataSource, dataSourcePropertyName,
         mode, format, null, null);
 }
开发者ID:leontius,项目名称:Ragnarok,代码行数:12,代码来源:BindingCollection.cs

示例15: DependencyWatcher

 public DependencyWatcher(
     Dependency[] dependencies, 
     BindingMode mode,
     BindindErrorOptions errorOptions
 ) {
     _dependencies = dependencies;
     _mode = mode;
     _errorOptions = errorOptions;
 }
开发者ID:svn2github,项目名称:azonlibrary,代码行数:9,代码来源:DependencyWatcher.cs


注:本文中的BindingMode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。