當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。