Skip to content

Commit

Permalink
Merge pull request #60 from WildernessLabs/fix/azure-build-fix
Browse files Browse the repository at this point in the history
Fix/azure build fix
  • Loading branch information
jorgedevs authored Jan 12, 2025
2 parents 64f0715 + 7f76a54 commit 94f2d18
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<ProjectReference Include="..\..\..\..\Meadow.ProjectLab\Source\Meadow.ProjectLab\Meadow.ProjectLab.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="app.build.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="app.config.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
2 changes: 2 additions & 0 deletions Source/Azure/ProjectLab_AzureIoTHub/app.build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deploy:
NoLink: [ ProjectLab ]
2 changes: 1 addition & 1 deletion Source/Meadow.Desktop/AvaloniaMeadow/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</Application.DataTemplates>

<Application.Styles>
<FluentTheme Mode="Light"/>
<FluentTheme />
</Application.Styles>
</Application>
2 changes: 1 addition & 1 deletion Source/Meadow.Desktop/AvaloniaMeadow/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace AvaloniaMeadow
{
public partial class App : AvaloniaMeadowApplication<Windows>
public partial class App : AvaloniaMeadowApplication<Meadow.Windows>
{
public override void OnFrameworkInitializationCompleted()
{
Expand Down
15 changes: 10 additions & 5 deletions Source/Meadow.Desktop/AvaloniaMeadow/AvaloniaMeadow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<PackageReference Include="Avalonia" Version="11.2.1" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.1" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.1" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.1" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.1" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.5.1" />
<PackageReference Include="Avalonia.Diagnostics" Version="11.2.1">
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>

</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 7 additions & 7 deletions Source/Meadow.Desktop/AvaloniaMeadow/ViewLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ namespace AvaloniaMeadow
{
public class ViewLocator : IDataTemplate
{
public IControl Build(object data)
public bool Match(object data)
{
return data is ViewModelBase;
}

Control? ITemplate<object?, Control?>.Build(object? param)
{
var name = data.GetType().FullName!.Replace("ViewModel", "View");
var name = param.GetType().FullName!.Replace("ViewModel", "View");
var type = Type.GetType(name);

if (type != null)
Expand All @@ -19,10 +24,5 @@ public IControl Build(object data)

return new TextBlock { Text = "Not Found: " + name };
}

public bool Match(object data)
{
return data is ViewModelBase;
}
}
}

0 comments on commit 94f2d18

Please sign in to comment.