Skip to content

Commit b1b2f44

Browse files
committed
Switch from Binding to Source-generated x:Bind
1 parent f6d807e commit b1b2f44

File tree

7 files changed

+40
-40
lines changed

7 files changed

+40
-40
lines changed

CollapseLauncher/XAMLs/MainApp/MainPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
BackRequested="NavigationViewControl_BackRequested"
4949
Background="Transparent"
5050
IsBackButtonVisible="Visible"
51-
IsBackEnabled="{Binding CanGoBack, ElementName=LauncherFrame, Mode=OneWay}"
51+
IsBackEnabled="{x:Bind LauncherFrame.CanGoBack, Mode=OneWay}"
5252
IsPaneOpen="False"
5353
IsSettingsVisible="true"
5454
ItemInvoked="NavView_ItemInvoked"

CollapseLauncher/XAMLs/MainApp/Pages/CachesPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
Text="%" />
153153
<TextBlock control:DockPanel.Dock="Right"
154154
Style="{ThemeResource BodyStrongTextBlockStyle}"
155-
Text="{Binding Value, ElementName=CachesTotalProgressBar}" />
155+
Text="{x:Bind CachesTotalProgressBar.Value, Mode=OneWay}" />
156156
</control:DockPanel>
157157
<ProgressBar x:Name="CachesTotalProgressBar"
158158
Height="25"

CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
Orientation="Horizontal">
125125
<TextBlock FontSize="12"
126126
FontWeight="Bold"
127-
Text="{Binding Value, ElementName=progressPrePerFileBar}" />
127+
Text="{x:Bind progressPrePerFileBar.Value, Mode=OneWay}" />
128128
<TextBlock FontSize="12"
129129
FontWeight="Bold"
130130
Text="%" />
@@ -171,7 +171,7 @@
171171
Orientation="Horizontal">
172172
<TextBlock FontSize="12"
173173
FontWeight="Bold"
174-
Text="{Binding Value, ElementName=progressPreBar}" />
174+
Text="{x:Bind progressPreBar.Value, Mode=OneWay}" />
175175
<TextBlock FontSize="12"
176176
FontWeight="Bold"
177177
Text="%" />
@@ -229,12 +229,12 @@
229229
Orientation="Horizontal">
230230
<TextBlock FontSize="12"
231231
FontWeight="Bold"
232-
Text="{Binding Text, ElementName=ProgressPrePerFileStatusFooter}" />
232+
Text="{x:Bind ProgressPrePerFileStatusFooter.Text, Mode=OneWay}" />
233233
</StackPanel>
234234
<TextBlock Margin="0,4,0,0"
235235
FontSize="12"
236236
FontWeight="Bold"
237-
Text="{Binding Text, ElementName=ProgressPreStatusFooter}" />
237+
Text="{x:Bind ProgressPreStatusFooter.Text, Mode=OneWay}" />
238238
</StackPanel>
239239
</Grid>
240240
</StackPanel>
@@ -254,15 +254,15 @@
254254
VerticalAlignment="Bottom">
255255
<TextBlock HorizontalAlignment="Right"
256256
FontSize="12"
257-
Text="{Binding Text, ElementName=ProgressPreStatusSubtitle}" />
257+
Text="{x:Bind ProgressPreStatusSubtitle.Text, Mode=OneWay}" />
258258
</StackPanel>
259259
<StackPanel Grid.Column="1"
260260
HorizontalAlignment="Left"
261261
VerticalAlignment="Bottom"
262262
Orientation="Horizontal">
263263
<TextBlock FontSize="12"
264264
FontWeight="Bold"
265-
Text="{Binding Value, ElementName=progressPreBar}" />
265+
Text="{x:Bind progressPreBar.Value, Mode=OneWay}" />
266266
<TextBlock FontSize="12"
267267
FontWeight="Bold"
268268
Text="%" />
@@ -285,7 +285,7 @@
285285
HorizontalAlignment="Right"
286286
FontSize="12"
287287
FontWeight="Bold"
288-
Text="{Binding Text, ElementName=ProgressPreTimeLeft}" />
288+
Text="{x:Bind ProgressPreTimeLeft.Text, Mode=OneWay}" />
289289
</StackPanel>
290290
</Grid>
291291
</StackPanel>
@@ -296,9 +296,9 @@
296296
Margin="0,8,0,24"
297297
HorizontalAlignment="Stretch"
298298
VerticalAlignment="Bottom"
299-
IsIndeterminate="{Binding IsIndeterminate, ElementName=progressPreBar}"
300-
Maximum="{Binding Maximum, ElementName=progressPreBar}"
301-
Value="{Binding Value, ElementName=progressPreBar}" />
299+
IsIndeterminate="{x:Bind progressPreBar.IsIndeterminate, Mode=OneWay}"
300+
Maximum="{x:Bind progressPreBar.Maximum, Mode=OneWay}"
301+
Value="{x:Bind progressPreBar.Value, Mode=OneWay}" />
302302
</Grid>
303303
<Grid x:Name="ProgressPreButtonGrid"
304304
Margin="0,-8,0,16"
@@ -930,9 +930,9 @@
930930
<ProgressRing Width="Auto"
931931
Height="Auto"
932932
HorizontalAlignment="Stretch"
933-
IsIndeterminate="{Binding IsIndeterminate, ElementName=SophonProgressRing}"
934-
Maximum="{Binding Maximum, ElementName=SophonProgressRing}"
935-
Value="{Binding Value, ElementName=SophonProgressRing}" />
933+
IsIndeterminate="{x:Bind SophonProgressRing.IsIndeterminate, Mode=OneWay}"
934+
Maximum="{x:Bind SophonProgressRing.Maximum, Mode=OneWay}"
935+
Value="{x:Bind SophonProgressRing.Value, Mode=OneWay}" />
936936
<Ellipse x:Name="SophonProgressRingBG"
937937
HorizontalAlignment="Stretch"
938938
Fill="{ThemeResource ProgressBackgroundAcrylicBrush}" />
@@ -950,9 +950,9 @@
950950
<ProgressRing Width="Auto"
951951
Height="Auto"
952952
HorizontalAlignment="Stretch"
953-
IsIndeterminate="{Binding IsIndeterminate, ElementName=SophonProgressRingPerFile}"
954-
Maximum="{Binding Maximum, ElementName=SophonProgressRingPerFile}"
955-
Value="{Binding Value, ElementName=SophonProgressRingPerFile}" />
953+
IsIndeterminate="{x:Bind SophonProgressRingPerFile.IsIndeterminate, Mode=OneWay}"
954+
Maximum="{x:Bind SophonProgressRingPerFile.Maximum, Mode=OneWay}"
955+
Value="{x:Bind SophonProgressRingPerFile.Value, Mode=OneWay}" />
956956
<Ellipse x:Name="SophonProgressRingBG2"
957957
Margin="4"
958958
HorizontalAlignment="Stretch"
@@ -1036,7 +1036,7 @@
10361036
<StackPanel HorizontalAlignment="Center"
10371037
Orientation="Horizontal">
10381038
<TextBlock FontWeight="Bold"
1039-
Text="{Binding Value, ElementName=SophonProgressRing}" />
1039+
Text="{x:Bind SophonProgressRing.Value, Mode=OneWay}" />
10401040
<TextBlock Margin="-1,0,0,0"
10411041
FontWeight="Bold"
10421042
Text="%" />
@@ -1245,9 +1245,9 @@
12451245
<ProgressRing Width="Auto"
12461246
Height="Auto"
12471247
HorizontalAlignment="Stretch"
1248-
IsIndeterminate="{Binding IsIndeterminate, ElementName=progressRing}"
1249-
Maximum="{Binding Maximum, ElementName=progressRing}"
1250-
Value="{Binding Value, ElementName=progressRing}" />
1248+
IsIndeterminate="{x:Bind progressRing.IsIndeterminate, Mode=OneWay}"
1249+
Maximum="{x:Bind progressRing.Maximum, Mode=OneWay}"
1250+
Value="{x:Bind progressRing.Value, Mode=OneWay}" />
12511251
<Ellipse x:Name="progressRingBG"
12521252
HorizontalAlignment="Stretch"
12531253
Fill="{ThemeResource ProgressBackgroundAcrylicBrush}" />
@@ -1265,9 +1265,9 @@
12651265
<ProgressRing Width="Auto"
12661266
Height="Auto"
12671267
HorizontalAlignment="Stretch"
1268-
IsIndeterminate="{Binding IsIndeterminate, ElementName=progressRingPerFile}"
1269-
Maximum="{Binding Maximum, ElementName=progressRingPerFile}"
1270-
Value="{Binding Value, ElementName=progressRingPerFile}" />
1268+
IsIndeterminate="{x:Bind progressRingPerFile.IsIndeterminate, Mode=OneWay}"
1269+
Maximum="{x:Bind progressRingPerFile.Maximum, Mode=OneWay}"
1270+
Value="{x:Bind progressRingPerFile.Value, Mode=OneWay}" />
12711271
<Grid x:Name="ProgressPerFileCircleShadowCaster"
12721272
Margin="4"
12731273
CornerRadius="{x:Bind extension:UIElementExtensions.AttachRoundedKindCornerRadius(ProgressPerFileCircleShadowCaster)}"
@@ -1323,7 +1323,7 @@
13231323
<StackPanel HorizontalAlignment="Center"
13241324
Orientation="Horizontal">
13251325
<TextBlock FontWeight="Bold"
1326-
Text="{Binding Value, ElementName=progressRing}" />
1326+
Text="{x:Bind progressRing.Value, Mode=OneWay}" />
13271327
<TextBlock Margin="-1,0,0,0"
13281328
FontWeight="Bold"
13291329
Text="%" />

CollapseLauncher/XAMLs/MainApp/Pages/RepairPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
Text="%" />
155155
<TextBlock control:DockPanel.Dock="Right"
156156
Style="{ThemeResource BodyStrongTextBlockStyle}"
157-
Text="{Binding Value, ElementName=RepairPerFileProgressBar}" />
157+
Text="{x:Bind RepairPerFileProgressBar.Value, Mode=OneWay}" />
158158
</control:DockPanel>
159159
<ProgressBar x:Name="RepairPerFileProgressBar"
160160
Height="25"
@@ -178,7 +178,7 @@
178178
Text="%" />
179179
<TextBlock control:DockPanel.Dock="Right"
180180
Style="{ThemeResource BodyStrongTextBlockStyle}"
181-
Text="{Binding Value, ElementName=RepairTotalProgressBar}" />
181+
Text="{x:Bind RepairTotalProgressBar.Value, Mode=OneWay}" />
182182
</control:DockPanel>
183183
<ProgressBar x:Name="RepairTotalProgressBar"
184184
Height="25"

CollapseLauncher/XAMLs/MainApp/Pages/SettingsPage.xaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@
696696
Margin="0,8,0,8"
697697
Header="{x:Bind helper:Locale.Lang._SettingsPage.NetworkSettings_Proxy_Hostname}"
698698
InputScope="Url"
699-
IsEnabled="{Binding IsOn, ElementName=NetworkSettingsProxyToggle}"
699+
IsEnabled="{x:Bind NetworkSettingsProxyToggle.IsOn, Mode=OneWay}"
700700
IsSpellCheckEnabled="False"
701701
PlaceholderText="Example: https://127.0.0.1:8080"
702702
Text="{x:Bind HttpProxyUrl, Mode=TwoWay}" />
@@ -718,14 +718,14 @@
718718
<RowDefinition />
719719
</Grid.RowDefinitions>
720720
<TextBox Header="{x:Bind helper:Locale.Lang._SettingsPage.NetworkSettings_Proxy_Username}"
721-
IsEnabled="{Binding IsOn, ElementName=NetworkSettingsProxyToggle}"
721+
IsEnabled="{x:Bind NetworkSettingsProxyToggle.IsOn, Mode=OneWay}"
722722
IsSpellCheckEnabled="False"
723723
PlaceholderText="{x:Bind helper:Locale.Lang._SettingsPage.NetworkSettings_Proxy_UsernamePlaceholder}"
724724
Text="{x:Bind conv:SettingsPage.HttpProxyUsername, Mode=TwoWay}" />
725725
<PasswordBox Grid.Row="0"
726726
Grid.Column="1"
727727
Header="{x:Bind helper:Locale.Lang._SettingsPage.NetworkSettings_Proxy_Password}"
728-
IsEnabled="{Binding IsOn, ElementName=NetworkSettingsProxyToggle}"
728+
IsEnabled="{x:Bind NetworkSettingsProxyToggle.IsOn, Mode=OneWay}"
729729
Password="{x:Bind conv:SettingsPage.HttpProxyPassword, Mode=TwoWay}"
730730
PasswordRevealMode="Peek"
731731
PlaceholderText="{x:Bind helper:Locale.Lang._SettingsPage.NetworkSettings_Proxy_PasswordPlaceholder}" />
@@ -737,9 +737,9 @@
737737
HorizontalAlignment="Stretch"
738738
HorizontalContentAlignment="Stretch"
739739
Click="ProxyConnectivityTestButton_Click"
740-
IsEnabled="{Binding IsOn, ElementName=NetworkSettingsProxyToggle}"
740+
IsEnabled="{x:Bind NetworkSettingsProxyToggle.IsOn, Mode=OneWay}"
741741
Style="{ThemeResource AcrylicButtonStyle}"
742-
Visibility="{Binding Text, ElementName=ProxyHostnameTextbox, Converter={StaticResource StringToVisibilityConverter}}">
742+
Visibility="{x:Bind ProxyHostnameTextbox.Text, Mode=OneWay, Converter={StaticResource StringToVisibilityConverter}}">
743743
<Grid HorizontalAlignment="Stretch">
744744
<Grid.ColumnDefinitions>
745745
<ColumnDefinition />
@@ -1398,7 +1398,7 @@
13981398
HorizontalAlignment="Stretch"
13991399
Header="{x:Bind helper:Locale.Lang._SettingsPage.Database_Url}"
14001400
InputScope="Url"
1401-
IsEnabled="{Binding IsOn, ElementName=DbToggle}"
1401+
IsEnabled="{x:Bind DbToggle.IsOn, Mode=OneWay}"
14021402
IsSpellCheckEnabled="False"
14031403
PlaceholderText="{x:Bind helper:Locale.Lang._SettingsPage.Database_Url_Example}"
14041404
Text="{x:Bind DbUrl, Mode=TwoWay}"
@@ -1411,7 +1411,7 @@
14111411
HorizontalAlignment="Stretch"
14121412
Header="{x:Bind helper:Locale.Lang._SettingsPage.Database_Token}"
14131413
InputScope="Password"
1414-
IsEnabled="{Binding Path=IsOn, ElementName=DbToggle}"
1414+
IsEnabled="{x:Bind DbToggle.IsOn, Mode=OneWay}"
14151415
Password="{x:Bind DbToken, Mode=TwoWay}"
14161416
PasswordChanged="DbTokenPasswordBox_OnPasswordChanged"
14171417
PlaceholderText="{x:Bind helper:Locale.Lang._SettingsPage.Database_Placeholder_DbTokenPasswordBox}" />
@@ -1423,7 +1423,7 @@
14231423
HorizontalAlignment="Stretch"
14241424
GotFocus="DbUserIdTextBox_GotFocus"
14251425
Header="{x:Bind helper:Locale.Lang._SettingsPage.Database_UserId}"
1426-
IsEnabled="{Binding Path=IsOn, ElementName=DbToggle}"
1426+
IsEnabled="{x:Bind DbToggle.IsOn, Mode=OneWay}"
14271427
IsSpellCheckEnabled="False"
14281428
LostFocus="DbUserIdTextBox_LostFocus"
14291429
PlaceholderText="{x:Bind helper:Locale.Lang._SettingsPage.Database_Placeholder_DbUserIdTextBox}"
@@ -1437,7 +1437,7 @@
14371437
HorizontalContentAlignment="Stretch"
14381438
Click="GenerateGuidButton_Click"
14391439
CornerRadius="14"
1440-
IsEnabled="{Binding Path=IsOn, ElementName=DbToggle}"
1440+
IsEnabled="{x:Bind DbToggle.IsOn, Mode=OneWay}"
14411441
Style="{ThemeResource AccentButtonStyle}">
14421442
<Grid ColumnSpacing="12">
14431443
<Grid.ColumnDefinitions>
@@ -1463,7 +1463,7 @@
14631463
HorizontalContentAlignment="Stretch"
14641464
Click="ValidateAndSaveDbButton_Click"
14651465
CornerRadius="14"
1466-
IsEnabled="{Binding Path=IsOn, ElementName=DbToggle}"
1466+
IsEnabled="{x:Bind DbToggle.IsOn, Mode=OneWay}"
14671467
Style="{ThemeResource AccentButtonStyle}">
14681468
<Grid ColumnSpacing="12">
14691469
<Grid.ColumnDefinitions>

CollapseLauncher/XAMLs/MainApp/Pages/UpdatePage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<TextBlock FontWeight="Bold"
9797
Text="{x:Bind helper:Locale.Lang._UpdatePage.UpdateHeader1}" />
9898
<StackPanel Orientation="Horizontal">
99-
<TextBlock Text="{Binding Value, ElementName=progressBar}"
99+
<TextBlock Text="{x:Bind progressBar.Value, Mode=OneWay}"
100100
TextAlignment="Left" />
101101
<TextBlock Text="%"
102102
TextAlignment="Left" />

0 commit comments

Comments
 (0)