Skip to content

A Swiss Army knife for developers.

Fixed bugs

Etienne Baudoux67cf54024ccf
diff --git a/src/app/dev/DevToys.Core/OSHelper.cs b/src/app/dev/DevToys.Core/OSHelper.cs
index 5be7083e4..edad7a194 100644
--- a/src/app/dev/DevToys.Core/OSHelper.cs
+++ b/src/app/dev/DevToys.Core/OSHelper.cs
@@ -22,6 +22,10 @@ public static class OSHelper
{
currentPlatform = Platform.Linux;
}
+ else if (OperatingSystem.IsBrowser())
+ {
+ currentPlatform = Platform.WASM;
+ }
else
{
ThrowHelper.ThrowPlatformNotSupportedException();
diff --git a/src/app/dev/DevToys.Tools/Sample/SampleToolFactory.cs b/src/app/dev/DevToys.Tools/Sample/SampleToolFactory.cs
index ebfd56081..fd37f1e92 100644
--- a/src/app/dev/DevToys.Tools/Sample/SampleToolFactory.cs
+++ b/src/app/dev/DevToys.Tools/Sample/SampleToolFactory.cs
@@ -14,6 +14,7 @@ namespace DevToys.Tools.Sample;
[TargetPlatform(Platform.Windows)] // Optional. Not putting any attribute means every platforms are supported.
[TargetPlatform(Platform.Linux)]
[TargetPlatform(Platform.MacCatalyst)]
+[TargetPlatform(Platform.WASM)]
internal sealed class SampleCommandLineTool : ICommandLineTool
{
[CommandLineOption(
@@ -40,7 +41,7 @@ internal sealed class SampleCommandLineTool : ICommandLineTool
[Author("John Doe")]
[ToolDisplayInformation(
IconFontName = "FluentSystemIcons",
- IconGlyph = "\u0108",
+ IconGlyph = "\uE670",
GroupName = "Encoders / Decoders",
ResourceManagerAssemblyIdentifier = nameof(DevToysToolsResourceManagerAssemblyIdentifier),
ResourceManagerBaseName = "DevToys.Tools.Sample.Sample",
@@ -66,7 +67,7 @@ internal sealed class EncodersDecodersGroup : GuiToolGroup
internal EncodersDecodersGroup()
{
IconFontName = "FluentSystemIcons";
- IconGlyph = "\u0108";
+ IconGlyph = "\uE670";
DisplayTitle = Sample.CommandDescription;
AccessibleName = Sample.CommandDescription;
}
diff --git a/src/app/dev/DevToys.UI/Views/MainWindow.xaml b/src/app/dev/DevToys.UI/Views/MainWindow.xaml
index 037c500fa..deb7d7548 100644
--- a/src/app/dev/DevToys.UI/Views/MainWindow.xaml
+++ b/src/app/dev/DevToys.UI/Views/MainWindow.xaml
@@ -132,9 +132,10 @@
FontFamily="{x:Bind ToolInstance.IconFontName, Converter={StaticResource StringToStaticResourceConverter}}"
Glyph="{x:Bind ToolInstance.IconGlyph}"/>
</NavigationViewItem.Icon>
- <!--<NavigationViewItem.ContextFlyout>
+ <NavigationViewItem.ContextFlyout>
<MenuFlyout>
- <MenuFlyoutItem
+ <!-- TODO -->
+ <!--<MenuFlyoutItem
Text="{Binding Instance.MainPage.OpenInNewWindow, Source={StaticResource LanguageManager}}"
Command="{Binding OpenToolInNewWindowCommand}"
CommandParameter="{x:Bind Metadata}">
@@ -142,38 +143,16 @@
<FontIcon Glyph="&#xF8B5;" />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
- <MenuFlyoutItem
- x:Name="AddToFavoritesButton"
- x:Load="{x:Bind IsFavorite, Mode=OneWay, Converter={StaticResource InvertedBooleanConverter}}"
- Visibility="{x:Bind Metadata.NotFavorable, Mode=OneTime, Converter={StaticResource InvertedBooleanToVisibilityConverter}}"
- Text="{Binding Instance.MainPage.AddToFavorites, Source={StaticResource LanguageManager}}"
- Command="{Binding AddToFavoritesCommand}"
- CommandParameter="{x:Bind}">
- <MenuFlyoutItem.Icon>
- <FontIcon Glyph="&#xF70F;" />
- </MenuFlyoutItem.Icon>
- </MenuFlyoutItem>
- <MenuFlyoutItem
- x:Name="RemoveFromFavoritesButton"
- x:Load="{x:Bind IsFavorite, Mode=OneWay}"
- Visibility="{x:Bind Metadata.NotFavorable, Mode=OneTime, Converter={StaticResource InvertedBooleanToVisibilityConverter}}"
- Text="{Binding Instance.MainPage.RemoveFromFavorites, Source={StaticResource LanguageManager}}"
- Command="{Binding RemoveFromFavoritesCommand}"
- CommandParameter="{x:Bind}">
- <MenuFlyoutItem.Icon>
- <FontIcon Glyph="&#xF71A;" />
- </MenuFlyoutItem.Icon>
- </MenuFlyoutItem>
<MenuFlyoutItem
Text="{Binding Instance.MainPage.PinToolToStart, Source={StaticResource LanguageManager}}"
Command="{Binding PinToolToStartCommand}"
- CommandParameter="{x:Bind Metadata}">
+ CommandParameter="{x:Bind ToolInstance}">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="&#xF601;" />
</MenuFlyoutItem.Icon>
- </MenuFlyoutItem>
+ </MenuFlyoutItem>-->
</MenuFlyout>
- </NavigationViewItem.ContextFlyout>-->
+ </NavigationViewItem.ContextFlyout>
<NavigationViewItem.Content>
<Grid>
<Grid.ColumnDefinitions>
diff --git a/src/app/dev/platforms/desktop/DevToys.MauiBlazor/Shared/MainLayout.razor.cs b/src/app/dev/platforms/desktop/DevToys.MauiBlazor/Shared/MainLayout.razor.cs
index 8488853f9..2041e8aeb 100644
--- a/src/app/dev/platforms/desktop/DevToys.MauiBlazor/Shared/MainLayout.razor.cs
+++ b/src/app/dev/platforms/desktop/DevToys.MauiBlazor/Shared/MainLayout.razor.cs
@@ -1,9 +1,11 @@
using DevToys.Api;
using DevToys.Api.Core.Theme;
+using DevToys.Core;
using DevToys.MauiBlazor.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.Fast.Components.FluentUI;
using Microsoft.Fast.Components.FluentUI.DesignTokens;
+using Platform = DevToys.Api.Platform;
namespace DevToys.MauiBlazor.Shared;