Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Quality: Improved UserControls codebase #13492

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Files.App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />

<!-- Styles for the custom icons -->
<ResourceDictionary Source="/ResourceDictionaries/PathIcons.xaml" />
<ResourceDictionary Source="/UserControls/SideBar/SideBarControls.xaml" />
<ResourceDictionary Source="ms-appx:///ResourceDictionaries/App.Theme.TextBlockStyles.xaml" />
<ResourceDictionary Source="ms-appx:///ResourceDictionaries/PathIcons.xaml" />
<ResourceDictionary Source="ms-appx:///UserControls/SideBar/SideBarControls.xaml" />
<ResourceDictionary Source="ms-appx:///ResourceDictionaries/TextBlockStyles.xaml" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<ResourceDictionary Source="ms-appx:///ResourceDictionaries/TextBlockStyles.xaml" />
<ResourceDictionary Source="ms-appx:///ResourceDictionaries/App.Theme.TextBlockStyles.xaml" />

The . makes the code more readable.

<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
Expand Down
14 changes: 7 additions & 7 deletions src/Files.App/Data/Contexts/ContentPage/ContentPageContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ private void ToolbarViewModel_PropertyChanged(object? sender, PropertyChangedEve
{
switch (e.PropertyName)
{
case nameof(ToolbarViewModel.CanGoBack):
case nameof(ToolbarViewModel.CanGoForward):
case nameof(ToolbarViewModel.CanNavigateToParent):
case nameof(ToolbarViewModel.HasItem):
case nameof(ToolbarViewModel.CanRefresh):
case nameof(ToolbarViewModel.IsSearchBoxVisible):
case nameof(AddressToolbarViewModel.CanGoBack):
case nameof(AddressToolbarViewModel.CanGoForward):
case nameof(AddressToolbarViewModel.CanNavigateToParent):
case nameof(AddressToolbarViewModel.HasItem):
case nameof(AddressToolbarViewModel.CanRefresh):
case nameof(AddressToolbarViewModel.IsSearchBoxVisible):
OnPropertyChanged(e.PropertyName);
break;
case nameof(ToolbarViewModel.SelectedItems):
case nameof(AddressToolbarViewModel.SelectedItems):
UpdateSelectedItems();
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Data/Models/ItemViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.ViewModels.Previews;
using Files.App.ViewModels.UserControls.Previews;
using Files.Core.Services.SizeProvider;
using Files.Shared.Helpers;
using LibGit2Sharp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Numerics;

namespace Files.App.Views
namespace Files.App.Data.Models
{
internal class NavigationInteractionTracker : IDisposable
{
Expand Down Expand Up @@ -214,7 +214,7 @@ public void IdleStateEntered(InteractionTracker sender, InteractionTrackerIdleSt
}
}
else
{
{
_parent._tracker.TryUpdatePositionWithAnimation(_returnAnimation);
}
_shouldBounceBack = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace Files.App.UserControls
namespace Files.App.Extensions
{
public class ImageFromBytes : DependencyObject
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using CommunityToolkit.Mvvm.DependencyInjection;
using Files.App.Utils;
using Files.App.ViewModels;
using Files.App.ViewModels.Previews;
using Files.App.ViewModels.UserControls.Previews;
using Files.Core.Services.Settings;
using IniParser.Model;
using System;
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this change?

File renamed without changes.
Loading