Skip to content

Commit 8c0691b

Browse files
committed
fix(WPF): add MahApps.Metro, ControlzEx, and XamlBehaviorsWpf as submodules and update references
- Completely fix conflict resource on different dll version - Introduced new submodules for MahApps.Metro, ControlzEx, and XamlBehaviorsWpf. - Updated Directory.Packages.props to remove direct MahApps.Metro reference and adjusted resource loading paths. - Refactored XAML files to use the new DevTools namespace for MahApps.Metro components. - Enhanced project structure in RevitDevTool.slnx to include new libraries.
1 parent 3b95b6e commit 8c0691b

30 files changed

Lines changed: 190 additions & 149 deletions

.github/workflows/Compile.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
uses: actions/checkout@v6
1818
with:
1919
fetch-depth: 0
20+
submodules: recursive
2021

2122
- name: Cache packages
2223
uses: actions/cache@v5

.github/workflows/PublishRelease.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
uses: actions/checkout@v6
2222
with:
2323
fetch-depth: 0
24+
submodules: recursive
2425

2526
- name: Create release tag
2627
if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != ''

.gitmodules

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[submodule "libs/XamlBehaviorsWpf"]
2+
path = libs/XamlBehaviorsWpf
3+
url = git@github.com:trgiangv/XamlBehaviorsWpf.git
4+
branch = devtools/main
5+
[submodule "libs/ControlzEx"]
6+
path = libs/ControlzEx
7+
url = git@github.com:trgiangv/ControlzEx.git
8+
branch = devtools/main
9+
[submodule "libs/MahApps.Metro"]
10+
path = libs/MahApps.Metro
11+
url = git@github.com:trgiangv/MahApps.Metro.git
12+
branch = devtools/main

Directory.Packages.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
<!--Console-->
2727
<PackageVersion Include="CliWrap" Version="3.10.0"/>
2828
<!--UI-->
29-
<PackageVersion Include="MahApps.Metro" Version="3.0.0-rc0529"/>
3029
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
3130
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.3800.47"/>
3231
<!--Build Tools-->

RevitDevTool.slnx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,42 @@
142142
</Project>
143143
<Project Path="source/RevitDevTool.Core/RevitDevTool.Core.csproj" />
144144
<Project Path="source/RevitDevTool/RevitDevTool.csproj" />
145+
<Folder Name="/Libs/">
146+
<Project Path="libs/MahApps.Metro/src/MahApps.Metro/MahApps.Metro.csproj">
147+
<BuildType Solution="Debug.Autodesk.2022|*" Project="Debug" />
148+
<BuildType Solution="Debug.Autodesk.2023|*" Project="Debug" />
149+
<BuildType Solution="Debug.Autodesk.2024|*" Project="Debug" />
150+
<BuildType Solution="Debug.Autodesk.2025|*" Project="Debug" />
151+
<BuildType Solution="Debug.Autodesk.2026|*" Project="Debug" />
152+
<BuildType Solution="Release.Autodesk.2022|*" Project="Release" />
153+
<BuildType Solution="Release.Autodesk.2023|*" Project="Release" />
154+
<BuildType Solution="Release.Autodesk.2024|*" Project="Release" />
155+
<BuildType Solution="Release.Autodesk.2025|*" Project="Release" />
156+
<BuildType Solution="Release.Autodesk.2026|*" Project="Release" />
157+
</Project>
158+
<Project Path="libs/ControlzEx/src/ControlzEx/ControlzEx.csproj">
159+
<BuildType Solution="Debug.Autodesk.2022|*" Project="Debug" />
160+
<BuildType Solution="Debug.Autodesk.2023|*" Project="Debug" />
161+
<BuildType Solution="Debug.Autodesk.2024|*" Project="Debug" />
162+
<BuildType Solution="Debug.Autodesk.2025|*" Project="Debug" />
163+
<BuildType Solution="Debug.Autodesk.2026|*" Project="Debug" />
164+
<BuildType Solution="Release.Autodesk.2022|*" Project="Release" />
165+
<BuildType Solution="Release.Autodesk.2023|*" Project="Release" />
166+
<BuildType Solution="Release.Autodesk.2024|*" Project="Release" />
167+
<BuildType Solution="Release.Autodesk.2025|*" Project="Release" />
168+
<BuildType Solution="Release.Autodesk.2026|*" Project="Release" />
169+
</Project>
170+
<Project Path="libs/XamlBehaviorsWpf/src/Microsoft.Xaml.Behaviors/Microsoft.Xaml.Behaviors.csproj">
171+
<BuildType Solution="Debug.Autodesk.2022|*" Project="Debug" />
172+
<BuildType Solution="Debug.Autodesk.2023|*" Project="Debug" />
173+
<BuildType Solution="Debug.Autodesk.2024|*" Project="Debug" />
174+
<BuildType Solution="Debug.Autodesk.2025|*" Project="Debug" />
175+
<BuildType Solution="Debug.Autodesk.2026|*" Project="Debug" />
176+
<BuildType Solution="Release.Autodesk.2022|*" Project="Release" />
177+
<BuildType Solution="Release.Autodesk.2023|*" Project="Release" />
178+
<BuildType Solution="Release.Autodesk.2024|*" Project="Release" />
179+
<BuildType Solution="Release.Autodesk.2025|*" Project="Release" />
180+
<BuildType Solution="Release.Autodesk.2026|*" Project="Release" />
181+
</Project>
182+
</Folder>
145183
</Solution>

libs/ControlzEx

Submodule ControlzEx added at d6fc4bc

libs/MahApps.Metro

Submodule MahApps.Metro added at ece6362

libs/XamlBehaviorsWpf

Submodule XamlBehaviorsWpf added at 0d6ba46

source/DevTools.Utilities/DevTools.Utilities.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="MahApps.Metro"/>
1514
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" />
1615
<PackageReference Include="PolySharp" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
1716
<PackageReference Include="Microsoft-WindowsAPICodePack-Shell" Condition="$(TargetFramework.StartsWith('net4'))" />

source/DevTools.Utilities/ResourceUtils.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Collections.ObjectModel;
22
using System.Windows;
3-
using MahApps.Metro.Controls;
43
// ReSharper disable ConvertToExtensionBlock
54

65
namespace DevTools.Utilities;
@@ -21,30 +20,19 @@ private static ResourceDictionary GetResource(string assemblyName, string resour
2120
return new ResourceDictionary { Source = uri };
2221
}
2322

24-
public static ResourceDictionary GetResource(Type type, string resourcePath)
25-
{
26-
var assembly = type.Assembly;
27-
var assemblyName = assembly.GetName();
28-
29-
var version = assemblyName.Version?.ToString(3);
30-
var uri = new Uri($"pack://application:,,,/{assemblyName.Name};v{version};component/{resourcePath}", UriKind.Absolute);
31-
32-
return new ResourceDictionary { Source = uri };
33-
}
34-
3523
public static ResourceDictionary GetMahAppsControls()
3624
{
37-
return _mahAppsControls ??= GetResource(typeof(HamburgerMenu), "Styles/Controls.xaml");
25+
return _mahAppsControls ??= GetResource("DevTools.MahApps.Metro", "Styles/Controls.xaml");
3826
}
3927

4028
public static ResourceDictionary GetMahAppsLightTheme()
4129
{
42-
return _mahAppsLightTheme ??= GetResource(typeof(HamburgerMenu), "Styles/Themes/Light.Blue.xaml");
30+
return _mahAppsLightTheme ??= GetResource("DevTools.MahApps.Metro", "Styles/Themes/Light.Blue.xaml");
4331
}
4432

4533
public static ResourceDictionary GetMahAppsDarkTheme()
4634
{
47-
return _mahAppsDarkTheme ??= GetResource(typeof(HamburgerMenu), "Styles/Themes/Dark.Blue.xaml");
35+
return _mahAppsDarkTheme ??= GetResource("DevTools.MahApps.Metro", "Styles/Themes/Dark.Blue.xaml");
4836
}
4937

5038
public static void RemoveIfNotNull(this Collection<ResourceDictionary> mergedDictionaries, ResourceDictionary? item)

0 commit comments

Comments
 (0)