本文整理汇总了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);
}
示例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);
}
示例3: XamlBindingDefinition
public XamlBindingDefinition(Control target, PerspexProperty targetProperty, PropertyPath sourcePropertyPath, BindingMode bindingMode)
{
this.target = target;
this.targetProperty = targetProperty;
this.sourcePropertyPath = sourcePropertyPath;
this.bindingMode = bindingMode;
}
示例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;
}
示例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;
}
示例6: XamlBindingDefinition
public XamlBindingDefinition(Control target, PerspexProperty targetProperty, PropertyPath sourcePropertyPath, BindingMode bindingMode)
{
_target = target;
_targetProperty = targetProperty;
_sourcePropertyPath = sourcePropertyPath;
_bindingMode = bindingMode;
}
示例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
}
示例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);
}
示例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;
}
示例10: XamlBindingDefinition
public XamlBindingDefinition(
string sourcePropertyPath,
BindingMode bindingMode)
{
SourcePropertyPath = sourcePropertyPath;
BindingMode = bindingMode;
}
示例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);
}
示例12: UnitTestSettings
public UnitTestSettings(BindingMode bindingMode, AssertMode assertMode, bool moduleInit, bool methodInit, bool defaultTestStub)
{
BindingMode = bindingMode;
AssertMode = assertMode;
ModuleInit = moduleInit;
MethodInit = methodInit;
DefaultTestStubInNewModule = defaultTestStub;
}
示例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;
}
示例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);
}
示例15: DependencyWatcher
public DependencyWatcher(
Dependency[] dependencies,
BindingMode mode,
BindindErrorOptions errorOptions
) {
_dependencies = dependencies;
_mode = mode;
_errorOptions = errorOptions;
}