Skip to content

Conversation

@VictoriousRaptor
Copy link
Contributor

@VictoriousRaptor VictoriousRaptor commented Jun 2, 2024

Use binding for values introduced in Resizable PR (#2699) to simplify code.

Tests:

  • Color schemes can be changed and saved.
  • Font can be changed and saved.

@VictoriousRaptor VictoriousRaptor added Code Refactor Dev branch only An issue or fix for the Dev branch build labels Jun 2, 2024
@VictoriousRaptor VictoriousRaptor self-assigned this Jun 2, 2024
@Yusyuriv
Copy link
Member

Yusyuriv commented Jun 2, 2024

I don't know if it's possible to post suggestions in the code that isn't included in the PR changes, so I'll write it here: maybe get rid of Reset_Click completely, since all the logic is now in the view model?

-    private void Reset_Click(object sender, RoutedEventArgs e)
-    {
-        _viewModel.Reset();
-    }
+    [RelayCommand]
     public void Reset()
     {
         SelectedQueryBoxFont = new FontFamily(DefaultFont);
                             <Button
                                 Margin="8"
                                 HorizontalAlignment="Stretch"
-                                Click="Reset_Click"
+                                Command="{Binding ResetCommand}" 
                                 Content="{DynamicResource resetCustomize}" />

@onesounds
Copy link
Contributor

Works fine. when you done and need approve, mention me again.

@VictoriousRaptor
Copy link
Contributor Author

I don't know if it's possible to post suggestions in the code that isn't included in the PR changes, so I'll write it here: maybe get rid of Reset_Click completely, since all the logic is now in the view model?

-    private void Reset_Click(object sender, RoutedEventArgs e)
-    {
-        _viewModel.Reset();
-    }
+    [RelayCommand]
     public void Reset()
     {
         SelectedQueryBoxFont = new FontFamily(DefaultFont);
                             <Button
                                 Margin="8"
                                 HorizontalAlignment="Stretch"
-                                Click="Reset_Click"
+                                Command="{Binding ResetCommand}" 
                                 Content="{DynamicResource resetCustomize}" />

Done.

@VictoriousRaptor VictoriousRaptor merged commit 9b9ebfc into dev Jun 9, 2024
@VictoriousRaptor VictoriousRaptor deleted the binding branch June 9, 2024 09:42
@jjw24 jjw24 added this to the 1.19.0 milestone Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Refactor Dev branch only An issue or fix for the Dev branch build

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants