添加项目

This commit is contained in:
GG Z
2026-01-01 10:02:59 +08:00
parent 1fd8d2ced7
commit 4df4ce1e6a
105 changed files with 4437 additions and 570 deletions

View File

@@ -1,4 +1,7 @@
using System.Collections.ObjectModel;
using System.Collections;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Resources;
using System.Windows;
using Autodesk.Revit.DB;
@@ -151,9 +154,14 @@ public class FamilyApp
gallery.RowsInWindowMode = 1;
gallery.ShowImage = true;
gallery.MinWidth = 400;
var resourceLocator = new Uri("ShrlAlgoToolkit.RevitAddins;component/WPFUI.xaml", UriKind.Relative);
var dictionary = (ResourceDictionary)Application.LoadComponent(resourceLocator);
// 1. 获取当前程序集的短名称 (例如 "ShrlAlgoToolkit.RevitAddins")
string assemblyName = Assembly.GetExecutingAssembly().GetName().Name;
// 2. 拼接 Pack URI
// 注意:格式通常是 "/{程序集名称};component/{路径}"
var resourceLocator = new Uri($"/{assemblyName};component/WPFUI.xaml", UriKind.Relative);
var dictionary = (ResourceDictionary)Application.LoadComponent(resourceLocator);
gallery.ItemTemplate = (DataTemplate)dictionary["FamilyGalleryItemTemplate"];
//绑定数据
gallery.ItemsBinding = new System.Windows.Data.Binding
@@ -165,11 +173,9 @@ public class FamilyApp
};
//绑定样式
}
public void CreateFamilyUI(UIControlledApplication application)
{
//AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
//application.CreateRibbonTab(TabName);
//UserPanel.AddAwItem(_loginPBData);