Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Files.App.Converters
{
internal class BoolToSelectionMode : IValueConverter
internal class BoolToSelectionModeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

using Microsoft.UI.Xaml.Data;

namespace Files.App.ValueConverters.EnumConverters
namespace Files.App.Converters
{
internal sealed class ConflictResolveOptionToIndexConverter : IValueConverter
internal class ConflictResolveOptionToIndexConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Files.App/Converters/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Files.App.Converters
/// </summary>
/// <typeparam name="TSource">The source type.</typeparam>
/// <typeparam name="TTarget">The target type.</typeparam>
public abstract class ValueConverter<TSource, TTarget> : IValueConverter
internal abstract class ValueConverter<TSource, TTarget> : IValueConverter
{
/// <summary>
/// Converts a source value to the target type.
Expand Down Expand Up @@ -89,7 +89,7 @@ public abstract class ValueConverter<TSource, TTarget> : IValueConverter
/// <summary>
/// The base class for converting instances of type T to object and vice versa.
/// </summary>
public abstract class ToObjectConverter<T> : ValueConverter<T?, object?>
internal abstract class ToObjectConverter<T> : ValueConverter<T?, object?>
{
/// <summary>
/// Converts a source value to the target type.
Expand Down Expand Up @@ -119,7 +119,7 @@ public abstract class ToObjectConverter<T> : ValueConverter<T?, object?>
/// <summary>
/// Converts a boolean to and from a visibility value.
/// </summary>
public class InverseBooleanConverter : ValueConverter<bool, bool>
internal class InverseBooleanConverter : ValueConverter<bool, bool>
{
/// <summary>
/// Converts a source value to the target type.
Expand All @@ -146,7 +146,7 @@ protected override bool ConvertBack(bool value, object? parameter, string? langu
}
}

public class NullToTrueConverter : ValueConverter<object?, bool>
internal class NullToTrueConverter : ValueConverter<object?, bool>
{
/// <summary>
/// Determines whether an inverse conversion should take place.
Expand Down Expand Up @@ -179,7 +179,7 @@ protected override bool Convert(object? value, object? parameter, string? langua
}
}

public class StringNullOrWhiteSpaceToTrueConverter : ValueConverter<string, bool>
internal class StringNullOrWhiteSpaceToTrueConverter : ValueConverter<string, bool>
{
/// <summary>
/// Determines whether an inverse conversion should take place.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Files.App.Converters
{
internal class DateTimeOffsetToString : IValueConverter
internal class DateTimeOffsetToStringConverter : IValueConverter
{
private static readonly IDateTimeFormatter formatter = Ioc.Default.GetService<IDateTimeFormatter>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Files.App.Converters
{
internal class DoubleArrayToString : IValueConverter
internal class DoubleArrayToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Converters
{
internal class DoubleToString : IValueConverter
internal class DoubleToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

using Microsoft.UI.Xaml.Data;

namespace Files.App.ValueConverters
namespace Files.App.Converters
{
internal sealed class GenericEnumConverter : IValueConverter
internal class GenericEnumConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using Files.App.AppModels;
using Microsoft.UI.Xaml.Data;

namespace Files.App.ValueConverters
namespace Files.App.Converters
{
internal sealed class ImageModelToImageConverter : IValueConverter
internal class ImageModelToImageConverter : IValueConverter
{
public object? Convert(object value, Type targetType, object parameter, string language)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Files.App.Converters
{
internal class StringArrayToString : IValueConverter
internal class StringArrayToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Media;

namespace Files.App.ValueConverters
namespace Files.App.Converters
{
internal sealed class StringToBrushConverter : IValueConverter
internal class StringToBrushConverter : IValueConverter
{
public object? Convert(object value, Type targetType, object parameter, string language)
{
if (value is not string strValue)
return null;

return new SolidColorBrush(ColorHelper.ToColor(strValue));
return new SolidColorBrush(strValue.ToColor());
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Files.App.Converters
{
internal class UInt32ToString : IValueConverter
internal class UInt32ToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Converters/VisibilityInvertConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Files.App.Converters
{
public class VisibilityInvertConverter : IValueConverter
internal class VisibilityInvertConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Dialogs/AddItemDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
x:Class="Files.App.Dialogs.AddItemDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:Files.App.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="using:Files.App.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vc="using:Files.App.ValueConverters"
xmlns:vm="using:Files.Backend.ViewModels.Dialogs.AddItemDialog"
x:Name="AddDialog"
Title="{helpers:ResourceString Name=AddDialog/Title}"
Expand All @@ -20,7 +20,7 @@
mc:Ignorable="d">

<ContentDialog.Resources>
<vc:ImageModelToImageConverter x:Key="ImageModelToImageConverter" />
<converters:ImageModelToImageConverter x:Key="ImageModelToImageConverter" />
</ContentDialog.Resources>

<Grid RowSpacing="25">
Expand Down
12 changes: 5 additions & 7 deletions src/Files.App/Dialogs/FilesystemOperationDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
x:Class="Files.App.Dialogs.FilesystemOperationDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:Files.App.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="using:Files.App.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ts="using:Files.App.TemplateSelectors"
xmlns:tvc="using:CommunityToolkit.WinUI.UI.Converters"
xmlns:vc="using:Files.App.ValueConverters"
xmlns:vc2="using:Files.App.ValueConverters.EnumConverters"
xmlns:vc3="using:Files.App.Converters"
xmlns:vm="using:Files.Backend.ViewModels.Dialogs.FileSystemDialog"
x:Name="RootDialog"
Title="{x:Bind ViewModel.Title, Mode=OneWay}"
Expand All @@ -29,10 +27,10 @@
<ContentDialog.Resources>
<x:Double x:Key="ContentDialogMaxWidth">800</x:Double>

<vc:ImageModelToImageConverter x:Key="ImageModelToImageConverter" />
<vc:GenericEnumConverter x:Key="GenericEnumConverter" />
<vc2:ConflictResolveOptionToIndexConverter x:Key="ConflictResolveOptionToIndexConverter" />
<vc3:VisibilityInvertConverter x:Key="VisibilityInvertConverter" />
<converters:ImageModelToImageConverter x:Key="ImageModelToImageConverter" />
<converters:GenericEnumConverter x:Key="GenericEnumConverter" />
<converters:ConflictResolveOptionToIndexConverter x:Key="ConflictResolveOptionToIndexConverter" />
<converters:VisibilityInvertConverter x:Key="VisibilityInvertConverter" />
<tvc:BoolNegationConverter x:Key="BoolNegationConverter" />

<DataTemplate x:Key="ConflictItemDataTemplate" x:DataType="vm:FileSystemDialogConflictItemViewModel">
Expand Down
8 changes: 4 additions & 4 deletions src/Files.App/ResourceDictionaries/PropertiesStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
<Setter Property="FontSize" Value="14" />
</Style>

<converters:StringArrayToString x:Key="StringArrayToString" />
<converters:UInt32ToString x:Key="UInt32ToString" />
<converters:DoubleToString x:Key="DoubleToString" />
<converters:DateTimeOffsetToString x:Key="DateTimeOffsetToString" />
<converters:StringArrayToStringConverter x:Key="StringArrayToString" />
<converters:UInt32ToStringConverter x:Key="UInt32ToString" />
<converters:DoubleToStringConverter x:Key="DoubleToString" />
<converters:DateTimeOffsetToStringConverter x:Key="DateTimeOffsetToString" />

<Style x:Key="Separator" TargetType="MenuFlyoutSeparator">
<Setter Property="Grid.Column" Value="0" />
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/UserControls/SidebarControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mconv="using:CommunityToolkit.WinUI.UI.Converters"
xmlns:navigationcontrolitems="using:Files.App.DataModels.NavigationControlItems"
xmlns:vc="using:Files.App.ValueConverters"
xmlns:converters="using:Files.App.Converters"
HorizontalAlignment="Stretch"
Collapsed="NavigationView_Collapsed"
DisplayModeChanged="SidebarControl_DisplayModeChanged"
Expand Down Expand Up @@ -52,7 +52,7 @@

<mconv:BoolNegationConverter x:Key="BoolNegationConverter" />
<mconv:StringFormatConverter x:Key="StringFormatConverter" />
<vc:StringToBrushConverter x:Key="StringToBrushConverter" />
<converters:StringToBrushConverter x:Key="StringToBrushConverter" />
<DataTemplate x:Key="LocationNavItem" x:DataType="navigationcontrolitems:LocationItem">
<NavigationViewItem
AllowDrop="True"
Expand Down
6 changes: 3 additions & 3 deletions src/Files.App/UserControls/Widgets/FileTagsWidget.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:converters="using:Files.App.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="using:Files.App.Helpers"
xmlns:local="using:Files.App.UserControls.Widgets"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vc="using:Files.App.ValueConverters"
xmlns:vm="using:Files.App.ViewModels.Widgets"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">

<UserControl.Resources>
<vc:StringToBrushConverter x:Key="StringToBrushConverter" />
<vc:ImageModelToImageConverter x:Key="ImageModelToImageConverter" />
<converters:StringToBrushConverter x:Key="StringToBrushConverter" />
<converters:ImageModelToImageConverter x:Key="ImageModelToImageConverter" />
</UserControl.Resources>

<!-- Collection of containers -->
Expand Down
10 changes: 5 additions & 5 deletions src/Files.App/ViewModels/Properties/Items/FileProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,29 +168,29 @@ private IValueConverter GetConverter()
{
if (Value is uint)
{
return new UInt32ToString();
return new UInt32ToStringConverter();
}

if (Value is double)
{
return new DoubleToString();
return new DoubleToStringConverter();
}

if (Value is DateTimeOffset)
{
return new DateTimeOffsetToString();
return new DateTimeOffsetToStringConverter();
}

if (Value is not null && Value.GetType().IsArray)
{
if (Value.GetType().GetElementType().Equals(typeof(string)))
{
return new StringArrayToString();
return new StringArrayToStringConverter();
}

if (Value.GetType().GetElementType().Equals(typeof(double)))
{
return new DoubleArrayToString();
return new DoubleArrayToStringConverter();
}
}
return null;
Expand Down
5 changes: 2 additions & 3 deletions src/Files.App/Views/LayoutModes/ColumnViewBase.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
xmlns:local="using:Files.App"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:uc="using:Files.App.UserControls"
xmlns:valueconverters="using:Files.App.ValueConverters"
xmlns:wct="using:CommunityToolkit.WinUI.UI"
xmlns:wctconverters="using:CommunityToolkit.WinUI.UI.Converters"
x:Name="PageRoot"
mc:Ignorable="d">

<local:StandardViewBase.Resources>

<valueconverters:StringToBrushConverter x:Key="StringToBrushConverter" />
<converters:StringToBrushConverter x:Key="StringToBrushConverter" />
<wctconverters:BoolNegationConverter x:Key="BoolNegationConverter" />
<wctconverters:BoolToVisibilityConverter
x:Key="NegatedBoolToVisibilityConverter"
Expand All @@ -33,7 +32,7 @@
x:Key="EmptyObjectToObjectConverter"
EmptyValue="Collapsed"
NotEmptyValue="Visible" />
<converters:BoolToSelectionMode x:Key="BoolToSelectionModeConverter" />
<converters:BoolToSelectionModeConverter x:Key="BoolToSelectionModeConverter" />

<Style TargetType="ListViewHeaderItem">
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
Expand Down
5 changes: 2 additions & 3 deletions src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:uc="using:Files.App.UserControls"
xmlns:valueconverters="using:Files.App.ValueConverters"
xmlns:wct="using:CommunityToolkit.WinUI.UI"
xmlns:wctconverters="using:CommunityToolkit.WinUI.UI.Converters"
x:Name="PageRoot"
Expand Down Expand Up @@ -46,8 +45,8 @@
x:Key="EmptyObjectToObjectConverter"
EmptyValue="Collapsed"
NotEmptyValue="Visible" />
<valueconverters:StringToBrushConverter x:Key="StringToBrushConverter" />
<converters:BoolToSelectionMode x:Key="BoolToSelectionModeConverter" />
<converters:StringToBrushConverter x:Key="StringToBrushConverter" />
<converters:BoolToSelectionModeConverter x:Key="BoolToSelectionModeConverter" />
<wctconverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />

<Style
Expand Down
5 changes: 2 additions & 3 deletions src/Files.App/Views/LayoutModes/GridViewBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:tui="using:CommunityToolkit.WinUI.UI"
xmlns:uc="using:Files.App.UserControls"
xmlns:vc="using:Files.App.ValueConverters"
xmlns:wctanimations="using:CommunityToolkit.WinUI.UI.Animations"
xmlns:wctconverters="using:CommunityToolkit.WinUI.UI.Converters"
x:Name="PageRoot"
Expand All @@ -33,7 +32,7 @@

<root:StandardViewBase.Resources>

<vc:StringToBrushConverter x:Key="StringToBrushConverter" />
<converters:StringToBrushConverter x:Key="StringToBrushConverter" />
<wctconverters:BoolNegationConverter x:Key="BoolNegationConverter" />
<wctconverters:BoolToVisibilityConverter
x:Key="NegatedBoolToVisibilityConverter"
Expand All @@ -52,7 +51,7 @@
x:Key="BoolToVisibilityConverter"
FalseValue="Collapsed"
TrueValue="Visible" />
<converters:BoolToSelectionMode x:Key="BoolToSelectionModeConverter" />
<converters:BoolToSelectionModeConverter x:Key="BoolToSelectionModeConverter" />

<DataTemplate x:Name="GridViewBrowserTemplate" x:DataType="filesystem:ListedItem">
<UserControl>
Expand Down
Loading