Skip to content

Commit e722eef

Browse files
committed
Update MercuryEngine.Data
1 parent 8ca1ddc commit e722eef

File tree

5 files changed

+28
-6
lines changed

5 files changed

+28
-6
lines changed

MercuryEngine.Data

Submodule MercuryEngine.Data updated 84 files
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Linq.Expressions;
2+
using System.Reflection;
3+
4+
namespace StudioZDR.App.Utility;
5+
6+
internal static class ReflectionUtility
7+
{
8+
public static PropertyInfo GetProperty(LambdaExpression expression)
9+
{
10+
if (expression is not { Body: MemberExpression { Member: PropertyInfo propertyInfo } })
11+
throw new ArgumentException("Expression must be a simple property access expression", nameof(expression));
12+
13+
return propertyInfo;
14+
}
15+
}

StudioZDR.App/ViewModels/ViewModelWithDataModel.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using MercuryEngine.Data.Core.Utility;
2-
using System.Linq.Expressions;
1+
using System.Linq.Expressions;
32
using System.Runtime.CompilerServices;
3+
using StudioZDR.App.Utility;
44

55
namespace StudioZDR.App.ViewModels;
66

@@ -10,7 +10,7 @@ public abstract class ViewModelWithDataModel<TDataModel> : ViewModelBase
1010

1111
protected void SetDataModelValue<TValue>(Expression<Func<TDataModel, TValue>> expression, TValue value, [CallerMemberName] string? propertyName = default)
1212
{
13-
var property = ExpressionUtility.GetProperty(expression);
13+
var property = ReflectionUtility.GetProperty(expression);
1414
var propertyValue = (TValue?) property.GetValue(DataModel);
1515

1616
this.RaiseAndSetIfChanged(ref propertyValue, value, propertyName);

StudioZDR.UI.Avalonia/StudioZDR.UI.Avalonia.csproj

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
<OutputType>WinExe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
7-
<!--Avalonia doesen't support TrimMode=link currently,but we are working on that https://github.com/AvaloniaUI/Avalonia/issues/6892 -->
8-
<TrimMode>copyused</TrimMode>
97
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
108
</PropertyGroup>
119

10+
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
11+
<PublishSingleFile>true</PublishSingleFile>
12+
<PublishTrimmed>true</PublishTrimmed>
13+
<TrimMode>partial</TrimMode>
14+
<SelfContained>true</SelfContained>
15+
</PropertyGroup>
16+
1217
<ItemGroup>
1318
<AvaloniaResource Include="Assets\**" />
1419
<None Remove=".gitignore" />

StudioZDR.sln.DotSettings

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=62107C8A_002D5C7C_002D4D14_002DBC07_002D6C9B6F4DBE0B_002Fdl_003ADataDefinitions_003A_002E_002E_003F_002E_002E_003FDataDefinitions/@EntryIndexedValue">ExplicitlyExcluded</s:String></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)