Skip to content

Commit

Permalink
🚧 別にラップする必要はないのか
Browse files Browse the repository at this point in the history
  • Loading branch information
Hibi-10000 committed Jan 1, 2025
1 parent 1b32abf commit 703c912
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 60 deletions.
6 changes: 3 additions & 3 deletions src/Hash.Wpf/Strings/ParentResource.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
xmlns:str="clr-namespace:Hash.Wpf.Strings"
xmlns:local="clr-namespace:Hash.Wpf">
<sys:String x:Key="AppName">HashCalculator</sys:String>
<str:String x:Key="Version" Text="{x:Static local:App.SemVer}"/>
<str:Strings x:Key="Title" Format="{}{0} {1}">
<x:Static x:Key="Version" Member="local:App.SemVer"/>
<str:Strings x:Key="Title" StringFormat="{}{0} {1}">
<StaticResource ResourceKey="AppName"/>
<str:StringResource ResourceKey="Version"/>
<StaticResource ResourceKey="Version"/>
</str:Strings>
</ResourceDictionary>
40 changes: 0 additions & 40 deletions src/Hash.Wpf/Strings/StringExtension.cs

This file was deleted.

16 changes: 1 addition & 15 deletions src/Hash.Wpf/Strings/StringResourceExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,4 @@ namespace Hash.Wpf.Strings;

[MarkupExtensionReturnType(typeof(object))]
[Localizability(LocalizationCategory.NeverLocalize)]
public class StringResourceExtension : StaticResourceExtension
{
//public StringResourceExtension() {}
//public StringResourceExtension(object resourceKey) : base(resourceKey) {}

//public override object? ProvideValue(IServiceProvider serviceProvider)
//{
// object? value = base.ProvideValue(serviceProvider);
// if (value is MarkupExtension me)
// {
// return me.ProvideValue(serviceProvider);
// }
// return value;
//}
}
public class StringResourceExtension : StaticResourceExtension;
4 changes: 2 additions & 2 deletions src/Hash.Wpf/Strings/StringsExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ public List<string> Strings

[DefaultValue(null)]
[StringSyntax("CompositeFormat")]
public string? Format
public string? StringFormat
{
get => _formatString;
set => _formatString = value;
}

public override object? ProvideValue(IServiceProvider serviceProvider)
public override string ProvideValue(IServiceProvider serviceProvider)
{
if (_formatString is not null)
{
Expand Down

0 comments on commit 703c912

Please sign in to comment.