This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (TrySetDefaultBindMode(xamlObjectDefinition)) | |
{ | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IDisposable TrySetDefaultBindMode(XamlObjectDefinition xamlObjectDefinition) | |
{ | |
var definedMode = xamlObjectDefinition.Members.FirstOrDefault(m => m.Member.Name == "DefaultBindMode")?.Value?.ToString(); | |
if (definedMode == null) | |
{ | |
return null; | |
} | |
else if (!IsValid(definedMode)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string GetDefaultBindMode() => _currentDefaultBindMode.Peek(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// The current DefaultBindMode for x:Bind bindings, as set by app code for the current Xaml subtree. | |
/// </summary> | |
private readonly Stack<string> _currentDefaultBindMode = new Stack<string>(new[] { "OneTime" }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ComboBoxTest.Command; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Input; | |
using Windows.Devices.Scanners; | |
using Windows.UI.Xaml.Controls; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<StackPanel x:DefaultBindMode="TwoWay"> | |
<TextBox Header="First name" Text="{x:Bind ViewModel.FirstName}" /> | |
<TextBox Header="Last name" Text="{x:Bind ViewModel.LastName}" /> | |
<CheckBox Content="Is subscribed" IsChecked="{x:Bind ViewModel.IsSubscribed}" /> | |
</StackPanel> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<StackPanel x:DefaultBindMode="OneWay"> | |
<TextBox Text="{x:Bind ViewModel.Name, Mode=TwoWay}" /> | |
<TextBlock Text="{x:Bind ViewModel.Name}" /> | |
</StackPanel> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Page | |
... | |
x:DefaultBindMode="OneWay"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid x:DefaultBindMode="OneWay"> | |
<TextBlock Text="{x:Bind ViewModel.Symbol}" /> | |
<TextBlock Text="{x:Bind ViewModel.Price}" /> | |
<TextBlock Text="{x:Bind ViewModel.PriceChange}" /> | |
</Grid> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid> | |
<TextBlock Text="{x:Bind ViewModel.Symbol}" /> | |
<TextBlock Text="{x:Bind ViewModel.Price}" /> | |
<TextBlock Text="{x:Bind ViewModel.PriceChange}" /> | |
</Grid> |