186 references to BindingMode
Microsoft.Maui.Controls (177)
BindableObject.cs (3)
49
BindingMode
.OneWay, null, BindingContextPropertyChanged, null, null, BindingContextPropertyBindingChanging);
289
=> SetBinding(targetProperty, binding, binding != null && targetProperty != null && binding.GetRealizedMode(targetProperty) ==
BindingMode
.TwoWay ? SetterSpecificity.FromHandler : SetterSpecificity.FromBinding);
296
if (targetProperty.IsReadOnly && binding.Mode ==
BindingMode
.OneWay)
BindableObjectExtensions.cs (4)
54
public static void SetBinding(this BindableObject self, BindableProperty targetProperty, string path,
BindingMode
mode =
BindingMode
.Default, IValueConverter converter = null,
133
BindingMode
mode =
BindingMode
.Default,
BindableProperty.cs (20)
77
BindableProperty(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue,
BindingMode
defaultBindingMode =
BindingMode
.OneWay,
89
if (defaultBindingMode !=
BindingMode
.Default && defaultBindingMode !=
BindingMode
.OneWay && defaultBindingMode !=
BindingMode
.OneWayToSource && defaultBindingMode !=
BindingMode
.TwoWay && defaultBindingMode !=
BindingMode
.OneTime)
98
if (defaultBindingMode ==
BindingMode
.Default)
99
defaultBindingMode =
BindingMode
.OneWay;
120
public
BindingMode
DefaultBindingMode { get; private set; }
148
public static BindableProperty Create(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue = null,
BindingMode
defaultBindingMode =
BindingMode
.OneWay,
157
public static BindableProperty CreateAttached(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue,
BindingMode
defaultBindingMode =
BindingMode
.OneWay,
165
public static BindablePropertyKey CreateAttachedReadOnly(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue,
BindingMode
defaultBindingMode =
BindingMode
.OneWayToSource,
175
public static BindablePropertyKey CreateReadOnly(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue,
BindingMode
defaultBindingMode =
BindingMode
.OneWayToSource,
184
internal static BindableProperty Create(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue,
BindingMode
defaultBindingMode, ValidateValueDelegate validateValue,
192
internal static BindableProperty CreateAttached(string propertyName, [DynamicallyAccessedMembers(ReturnTypeMembers)] Type returnType, [DynamicallyAccessedMembers(DeclaringTypeMembers)] Type declaringType, object defaultValue,
BindingMode
defaultBindingMode, ValidateValueDelegate validateValue,
Binding.cs (2)
29
public Binding(string path,
BindingMode
mode =
BindingMode
.Default, IValueConverter converter = null, object converterParameter = null, string stringFormat = null, object source = null)
BindingBase.Create.cs (2)
23
BindingMode
mode =
BindingMode
.Default,
BindingBase.cs (8)
14
BindingMode
_mode =
BindingMode
.Default;
25
public
BindingMode
Mode
30
if (value !=
BindingMode
.Default
31
&& value !=
BindingMode
.OneWay
32
&& value !=
BindingMode
.OneWayToSource
33
&& value !=
BindingMode
.TwoWay
34
&& value !=
BindingMode
.OneTime)
BindingBaseExtensions.cs (5)
9
public static
BindingMode
GetRealizedMode(this BindingBase self, BindableProperty property)
11
var
mode = self.Mode !=
BindingMode
.Default ? self.Mode : property.DefaultBindingMode;
13
if (mode ==
BindingMode
.TwoWay && property.IsReadOnly)
14
return
BindingMode
.OneWayToSource;
BindingExpression.cs (10)
123
BindingMode
mode = Binding.GetRealizedMode(_targetProperty);
124
if ((mode ==
BindingMode
.OneWay || mode ==
BindingMode
.OneTime) && fromTarget)
127
bool needsGetter = (mode ==
BindingMode
.TwoWay && !fromTarget) || mode ==
BindingMode
.OneWay || mode ==
BindingMode
.OneTime;
128
bool needsSetter = !needsGetter && ((mode ==
BindingMode
.TwoWay && fromTarget) || mode ==
BindingMode
.OneWayToSource);
157
if (part.NextPart != null && (mode ==
BindingMode
.OneWay || mode ==
BindingMode
.TwoWay)
Cells\EntryCell.cs (1)
12
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(EntryCell), null,
BindingMode
.TwoWay);
Cells\SwitchCell.cs (1)
15
}, defaultBindingMode:
BindingMode
.TwoWay);
CheckBox\CheckBox.cs (1)
22
}, defaultBindingMode:
BindingMode
.TwoWay);
Compatibility\iOS\Extensions\UIViewExtensions.cs (1)
69
if (bindingBase.Mode ==
BindingMode
.TwoWay)
DatePicker\DatePicker.cs (1)
15
public static readonly BindableProperty DateProperty = BindableProperty.Create(nameof(Date), typeof(DateTime), typeof(DatePicker), default(DateTime),
BindingMode
.TwoWay,
IndicatorView\IndicatorView.cs (1)
21
public static readonly BindableProperty PositionProperty = BindableProperty.Create(nameof(Position), typeof(int), typeof(IndicatorView), default(int),
BindingMode
.TwoWay);
InputView\InputView.cs (1)
12
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(InputView), defaultBindingMode:
BindingMode
.TwoWay,
Items\CarouselView.cs (3)
27
public static readonly BindableProperty LoopProperty = BindableProperty.Create(nameof(Loop), typeof(bool), typeof(CarouselView), true,
BindingMode
.OneTime);
97
BindableProperty.Create(nameof(CurrentItem), typeof(object), typeof(CarouselView), default,
BindingMode
.TwoWay,
154
BindableProperty.Create(nameof(Position), typeof(int), typeof(CarouselView), default(int),
BindingMode
.TwoWay,
Items\SelectableItemsView.cs (2)
19
defaultBindingMode:
BindingMode
.TwoWay,
25
defaultBindingMode:
BindingMode
.OneWay,
ListView\ListView.cs (3)
31
public static readonly BindableProperty IsRefreshingProperty = BindableProperty.Create(nameof(IsRefreshing), typeof(bool), typeof(ListView), false,
BindingMode
.TwoWay);
51
public static readonly BindableProperty SelectedItemProperty = BindableProperty.Create(nameof(SelectedItem), typeof(object), typeof(ListView), null,
BindingMode
.OneWayToSource,
417
textCell.SetBinding(TextCell.TextProperty, static (object cell) => cell,
BindingMode
.OneWay, _toStringValueConverter);
MultiBinding.cs (6)
88
if (this.GetRealizedMode(_targetProperty) ==
BindingMode
.OneTime)
91
if (fromTarget && this.GetRealizedMode(_targetProperty) ==
BindingMode
.OneWay)
94
if (!fromTarget && this.GetRealizedMode(_targetProperty) ==
BindingMode
.OneWayToSource)
156
var
bindingMode = Mode ==
BindingMode
.Default ? targetProperty.DefaultBindingMode : Mode;
169
if (this.GetRealizedMode(_targetProperty) ==
BindingMode
.OneWayToSource)
MultiPage.cs (1)
25
public static readonly BindableProperty SelectedItemProperty = BindableProperty.Create(nameof(SelectedItem), typeof(object), typeof(MultiPage<>), null,
BindingMode
.TwoWay);
Picker\Picker.cs (2)
34
BindableProperty.Create(nameof(SelectedIndex), typeof(int), typeof(Picker), -1,
BindingMode
.TwoWay,
44
BindableProperty.Create(nameof(SelectedItem), typeof(object), typeof(Picker), null,
BindingMode
.TwoWay,
PlatformBindingHelpers.cs (3)
48
if (binding != null && binding.Mode !=
BindingMode
.OneWay && propertyChanged != null)
58
if (binding != null && binding.Mode !=
BindingMode
.OneWay)
72
defaultBindingMode:
BindingMode
.Default,
RadioButton\RadioButton.cs (3)
65
defaultBindingMode:
BindingMode
.TwoWay);
561
contentPresenter.SetBinding(MarginProperty, static (RadioButton radio) => radio.Padding,
BindingMode
.OneWay, source: RelativeBindingSource.TemplatedParent);
562
contentPresenter.SetBinding(BackgroundColorProperty, static (RadioButton radio) => radio.BackgroundColor,
BindingMode
.OneWay, source: RelativeBindingSource.TemplatedParent);
RadioButton\RadioButtonGroup.cs (1)
41
defaultBindingMode:
BindingMode
.TwoWay,
RefreshView\RefreshView.cs (1)
30
BindableProperty.Create(nameof(IsRefreshing), typeof(bool), typeof(RefreshView), false,
BindingMode
.TwoWay, coerceValue: OnIsRefreshingPropertyCoerced, propertyChanged: OnIsRefreshingPropertyChanged);
Shell\BackButtonBehavior.cs (6)
12
BindableProperty.Create(nameof(CommandParameter), typeof(object), typeof(BackButtonBehavior), null,
BindingMode
.OneTime,
17
BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(BackButtonBehavior), null,
BindingMode
.OneTime,
22
BindableProperty.Create(nameof(IconOverride), typeof(ImageSource), typeof(BackButtonBehavior), null,
BindingMode
.OneTime);
26
BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(BackButtonBehavior), true,
BindingMode
.OneWay);
30
BindableProperty.Create(nameof(IsVisible), typeof(bool), typeof(BackButtonBehavior), true,
BindingMode
.OneWay);
34
BindableProperty.Create(nameof(TextOverride), typeof(string), typeof(BackButtonBehavior), null,
BindingMode
.OneTime);
Shell\BaseShellItem.cs (4)
37
BindableProperty.Create(nameof(FlyoutIcon), typeof(ImageSource), typeof(BaseShellItem), null,
BindingMode
.OneTime);
41
BindableProperty.Create(nameof(Icon), typeof(ImageSource), typeof(BaseShellItem), null,
BindingMode
.OneWay,
49
BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(BaseShellItem), true,
BindingMode
.OneWay);
53
BindableProperty.Create(nameof(Title), typeof(string), typeof(BaseShellItem), null,
BindingMode
.TwoWay, propertyChanged: OnTitlePropertyChanged);
Shell\MenuShellItem.cs (4)
18
this.SetBinding(TitleProperty, static (MenuItem item) => item.Text,
BindingMode
.OneWay, source: menuItem);
19
this.SetBinding(IconProperty, static (MenuItem item) => item.IconImageSource,
BindingMode
.OneWay, source: menuItem);
20
this.SetBinding(FlyoutIconProperty, static (MenuItem item) => item.IconImageSource,
BindingMode
.OneWay, source: menuItem);
21
this.SetBinding(AutomationIdProperty, static (MenuItem item) => item.AutomationId,
BindingMode
.OneWay, source: menuItem);
Shell\SearchHandler.cs (19)
313
BindableProperty.Create(nameof(ClearIconHelpText), typeof(string), typeof(SearchHandler), null,
BindingMode
.OneTime,
318
BindableProperty.Create(nameof(ClearIconName), typeof(string), typeof(SearchHandler), null,
BindingMode
.OneTime,
323
BindableProperty.Create(nameof(ClearIcon), typeof(ImageSource), typeof(SearchHandler), null,
BindingMode
.OneTime);
332
BindableProperty.Create(nameof(ClearPlaceholderCommand), typeof(ICommand), typeof(SearchHandler), null,
BindingMode
.OneTime,
341
BindableProperty.Create(nameof(ClearPlaceholderHelpText), typeof(string), typeof(SearchHandler), null,
BindingMode
.OneTime,
346
BindableProperty.Create(nameof(ClearPlaceholderIcon), typeof(ImageSource), typeof(SearchHandler), null,
BindingMode
.OneTime,
351
BindableProperty.Create(nameof(ClearPlaceholderName), typeof(string), typeof(SearchHandler), null,
BindingMode
.OneTime,
361
BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(SearchHandler), null,
BindingMode
.OneTime,
367
BindableProperty.Create(nameof(DisplayMemberName), typeof(string), typeof(SearchHandler), null,
BindingMode
.OneTime);
372
BindableProperty.Create(nameof(IsSearchEnabled), typeof(bool), typeof(SearchHandler), true,
BindingMode
.OneWay);
376
BindableProperty.Create(nameof(ItemsSource), typeof(IEnumerable), typeof(SearchHandler), null,
BindingMode
.OneTime,
381
BindableProperty.Create(nameof(ItemTemplate), typeof(DataTemplate), typeof(SearchHandler), null,
BindingMode
.OneTime);
385
BindableProperty.Create(nameof(QueryIconHelpText), typeof(string), typeof(SearchHandler), null,
BindingMode
.OneTime,
390
BindableProperty.Create(nameof(QueryIconName), typeof(string), typeof(SearchHandler), null,
BindingMode
.OneTime,
395
BindableProperty.Create(nameof(QueryIcon), typeof(ImageSource), typeof(SearchHandler), null,
BindingMode
.OneTime,
400
BindableProperty.Create(nameof(Query), typeof(string), typeof(SearchHandler), null,
BindingMode
.TwoWay,
405
BindableProperty.Create(nameof(SearchBoxVisibility), typeof(SearchBoxVisibility), typeof(SearchHandler), SearchBoxVisibility.Expanded,
BindingMode
.OneWay);
408
BindableProperty.CreateReadOnly(nameof(SelectedItem), typeof(object), typeof(SearchHandler), null,
BindingMode
.OneWayToSource);
415
BindableProperty.Create(nameof(ShowsResults), typeof(bool), typeof(SearchHandler), false,
BindingMode
.OneTime);
Shell\Shell.cs (18)
35
BindableProperty.CreateAttached("BackButtonBehavior", typeof(BackButtonBehavior), typeof(Shell), null,
BindingMode
.OneTime,
91
BindableProperty.CreateAttached("SearchHandler", typeof(SearchHandler), typeof(Shell), null,
BindingMode
.OneTime,
148
BindableProperty.CreateAttached(nameof(MenuItemTemplate), typeof(DataTemplate), typeof(Shell), null,
BindingMode
.OneTime);
172
BindableProperty.CreateAttached(nameof(ItemTemplate), typeof(DataTemplate), typeof(Shell), null,
BindingMode
.OneTime);
1060
BindableProperty.Create(nameof(CurrentItem), typeof(ShellItem), typeof(Shell), null,
BindingMode
.TwoWay,
1074
BindableProperty.Create(nameof(FlyoutBackgroundImage), typeof(ImageSource), typeof(Shell), default(ImageSource),
BindingMode
.OneTime);
1080
BindableProperty.Create(nameof(FlyoutBackgroundImageAspect), typeof(Aspect), typeof(Shell), default(Aspect),
BindingMode
.OneTime);
1086
BindableProperty.Create(nameof(FlyoutBackgroundColor), typeof(Color), typeof(Shell), null,
BindingMode
.OneTime);
1090
BindableProperty.Create(nameof(FlyoutBackground), typeof(Brush), typeof(Shell), SolidColorBrush.Default,
BindingMode
.OneTime);
1094
BindableProperty.Create(nameof(FlyoutHeaderBehavior), typeof(FlyoutHeaderBehavior), typeof(Shell), FlyoutHeaderBehavior.Default,
BindingMode
.OneTime);
1101
BindableProperty.Create(nameof(FlyoutHeader), typeof(object), typeof(Shell), null,
BindingMode
.OneTime,
1109
BindableProperty.Create(nameof(FlyoutFooter), typeof(object), typeof(Shell), null,
BindingMode
.OneTime,
1116
BindableProperty.Create(nameof(FlyoutHeaderTemplate), typeof(DataTemplate), typeof(Shell), null,
BindingMode
.OneTime,
1123
BindableProperty.Create(nameof(FlyoutFooterTemplate), typeof(DataTemplate), typeof(Shell), null,
BindingMode
.OneTime,
1130
BindableProperty.Create(nameof(FlyoutIsPresented), typeof(bool), typeof(Shell), false,
BindingMode
.TwoWay);
1172
new AppThemeBinding { Light = Colors.White, Dark = Colors.Black, Mode =
BindingMode
.OneWay });
2014
BindableProperty.Create(nameof(FlyoutContent), typeof(object), typeof(Shell), null,
BindingMode
.OneTime, propertyChanging: OnFlyoutContentChanging);
2021
BindableProperty.Create(nameof(FlyoutContentTemplate), typeof(DataTemplate), typeof(Shell), null,
BindingMode
.OneTime, propertyChanging: OnFlyoutContentTemplateChanging);
Shell\ShellContent.cs (5)
26
BindableProperty.Create(nameof(Content), typeof(object), typeof(ShellContent), null,
BindingMode
.OneTime, propertyChanged: OnContentChanged);
30
BindableProperty.Create(nameof(ContentTemplate), typeof(DataTemplate), typeof(ShellContent), null,
BindingMode
.OneTime);
291
shellContent.SetBinding(TitleProperty, static (TemplatedPage page) => page.Title,
BindingMode
.OneWay, source: page);
292
shellContent.SetBinding(IconProperty, static (TemplatedPage page) => page.IconImageSource,
BindingMode
.OneWay, source: page);
293
shellContent.SetBinding(FlyoutIconProperty, static (TemplatedPage page) => page.IconImageSource,
BindingMode
.OneWay, source: page);
Shell\ShellGroupItem.cs (1)
11
BindableProperty.Create(nameof(FlyoutDisplayOptions), typeof(FlyoutDisplayOptions), typeof(ShellGroupItem), FlyoutDisplayOptions.AsSingleItem,
BindingMode
.OneTime, propertyChanged: OnFlyoutDisplayOptionsPropertyChanged);
Shell\ShellItem.cs (5)
142
BindableProperty.Create(nameof(CurrentItem), typeof(ShellSection), typeof(ShellItem), null,
BindingMode
.TwoWay,
226
result.SetBinding(TitleProperty, static (ShellSection section) => section.Title,
BindingMode
.OneWay, source: shellSection);
227
result.SetBinding(IconProperty, static (ShellSection section) => section.Icon,
BindingMode
.OneWay, source: shellSection);
228
result.SetBinding(FlyoutDisplayOptionsProperty, static (ShellSection section) => section.FlyoutDisplayOptions,
BindingMode
.OneTime, source: shellSection);
229
result.SetBinding(FlyoutIconProperty, static (ShellSection section) => section.FlyoutIcon,
BindingMode
.OneWay, source: shellSection);
Shell\ShellSection.cs (4)
205
BindableProperty.Create(nameof(CurrentItem), typeof(ShellContent), typeof(ShellSection), null,
BindingMode
.TwoWay,
296
shellSection.SetBinding(TitleProperty, static (BaseShellItem item) => item.Title,
BindingMode
.OneWay, source: shellContent);
297
shellSection.SetBinding(IconProperty, static (BaseShellItem item) => item.Icon,
BindingMode
.OneWay, source: shellContent);
298
shellSection.SetBinding(FlyoutIconProperty, static (BaseShellItem item) => item.FlyoutIcon,
BindingMode
.OneWay, source: shellContent);
Slider\Slider.cs (1)
28
public static readonly BindableProperty ValueProperty = BindableProperty.Create(nameof(Value), typeof(double), typeof(Slider), 0d,
BindingMode
.TwoWay, coerceValue: (bindable, value) =>
Span.cs (3)
22
propertyChanged: (bindable, oldvalue, newvalue) => ((Span)bindable)._mergedStyle.Style = (Style)newvalue, defaultBindingMode:
BindingMode
.OneWay);
39
= BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(Span), default(Color), defaultBindingMode:
BindingMode
.OneWay);
81
= BindableProperty.Create(nameof(Text), typeof(string), typeof(Span), "", defaultBindingMode:
BindingMode
.OneWay);
Stepper\Stepper.cs (1)
32
public static readonly BindableProperty ValueProperty = BindableProperty.Create(nameof(Value), typeof(double), typeof(Stepper), 0.0,
BindingMode
.TwoWay,
SwipeView\SwipeView.cs (4)
40
BindableProperty.Create(nameof(LeftItems), typeof(SwipeItems), typeof(SwipeView), null,
BindingMode
.OneWay, null, defaultValueCreator: SwipeItemsDefaultValueCreator,
45
BindableProperty.Create(nameof(RightItems), typeof(SwipeItems), typeof(SwipeView), null,
BindingMode
.OneWay, null, defaultValueCreator: SwipeItemsDefaultValueCreator,
50
BindableProperty.Create(nameof(TopItems), typeof(SwipeItems), typeof(SwipeView), null,
BindingMode
.OneWay, null, defaultValueCreator: SwipeItemsDefaultValueCreator,
55
BindableProperty.Create(nameof(BottomItems), typeof(SwipeItems), typeof(SwipeView), null,
BindingMode
.OneWay, null, defaultValueCreator: SwipeItemsDefaultValueCreator,
Switch\Switch.cs (1)
23
}, defaultBindingMode:
BindingMode
.TwoWay);
TemplateBinding.cs (2)
26
public TemplateBinding(string path,
BindingMode
mode =
BindingMode
.Default, IValueConverter converter = null, object converterParameter = null, string stringFormat = null)
TimePicker\TimePicker.cs (1)
21
public static readonly BindableProperty TimeProperty = BindableProperty.Create(nameof(Time), typeof(TimeSpan), typeof(TimePicker), new TimeSpan(0),
BindingMode
.TwoWay,
TypedBinding.cs (12)
98
BindingMode
mode =
BindingMode
.Default,
296
var
mode = this.GetRealizedMode(property);
297
if ((mode ==
BindingMode
.OneWay || mode ==
BindingMode
.OneTime) && fromTarget)
300
var needsGetter = (mode ==
BindingMode
.TwoWay && !fromTarget) || mode ==
BindingMode
.OneWay || mode ==
BindingMode
.OneTime;
302
if (isTSource && (mode ==
BindingMode
.OneWay || mode ==
BindingMode
.TwoWay) && _handlers != null)
329
var needsSetter = (mode ==
BindingMode
.TwoWay && fromTarget) || mode ==
BindingMode
.OneWayToSource;
Microsoft.Maui.Controls.Build.Tasks (5)
SetPropertiesVisitor.cs (5)
438
|| !Enum.TryParse((modeNode as ValueNode)?.Value as string, true, out
BindingMode
declaredmode))
439
declaredmode =
BindingMode
.TwoWay; //meaning the mode isn't specified in the Binding extension. generate getters, setters, handlers
556
if (declaredmode !=
BindingMode
.OneTime && declaredmode !=
BindingMode
.OneWay)
563
if (declaredmode !=
BindingMode
.OneTime)
Microsoft.Maui.Controls.Xaml (4)
MarkupExtensions\BindingExtension.cs (2)
13
public
BindingMode
Mode { get; set; } =
BindingMode
.Default;
MarkupExtensions\TemplateBindingExtension.cs (2)
15
Mode =
BindingMode
.Default;
21
public
BindingMode
Mode { get; set; }