Skip to content

Commit 516914f

Browse files
committed
changed xaml code to code to avoid crash
1 parent 92b7a2c commit 516914f

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/FocusBehavior/FocusBehaviorXaml.bind

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
<interactivity:Interaction.Behaviors>
1010
<behaviors:FocusBehavior>
11-
<behaviors:FocusTarget Control="{Binding ElementName=disabledItem}" />
12-
<behaviors:FocusTarget Control="{Binding ElementName=emptyList}" />
13-
<behaviors:FocusTarget Control="{Binding ElementName=enabledItem}" />
11+
<behaviors:FocusTarget Control="{x:Bind disabledItem}" />
12+
<behaviors:FocusTarget Control="{x:Bind emptyList}" />
13+
<behaviors:FocusTarget Control="{x:Bind enabledItem}" />
1414
</behaviors:FocusBehavior>
1515
</interactivity:Interaction.Behaviors>
1616

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@
897897
"Subcategory": "Systems",
898898
"About": "Behavior to automatically set the focus on the first control which accepts it",
899899
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Behaviors/",
900-
"XamlCodeFile": "FocusBehaviorXaml.bind",
900+
"CodeFile": "FocusBehaviorXaml.bind",
901901
"Icon": "/Assets/Helpers.png",
902902
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/FocusBehavior.md"
903903
},

Microsoft.Toolkit.Uwp.UI/Behaviors/FocusBehavior.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ private void ApplyFocus()
112112
}
113113
}
114114

115-
private void OnControlPropertyChanged(DependencyObject sender, DependencyProperty dp) => ApplyFocus();
116-
117115
private void OnEngagementTimerTick(object sender, object e)
118116
{
119117
ApplyFocus();

0 commit comments

Comments
 (0)