整理代码

This commit is contained in:
GG Z
2025-04-24 20:56:10 +08:00
parent 4d798e5d99
commit 155cef46f8
532 changed files with 1018 additions and 854 deletions

View File

@@ -0,0 +1,42 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using System.Windows.Media;
namespace ShrlAlgo.RvKits.Windows
{
public partial class ColorPickerViewModel : ObservableObject
{
public ColorPickerViewModel(Color color)
{
SelectedColor = color;
//this.IsActive = true;
//WeakReferenceMessenger.Default.Register<ColorPickerViewModel>(this, (r, m) =>
//{
// // Handle the message here, with r being the recipient and m being the
// // input message. Using the recipient passed as input makes it so that
// // the lambda expression doesn't capture "this", improving performance.
//});
}
[ObservableProperty]
private Color selectedColor;
[RelayCommand]
private void Confirm(object obj)
{
if (obj is System.Windows.Window window)
{
var colorMessage = new Autodesk.Revit.DB.Color(
SelectedColor.R,
SelectedColor.G,
SelectedColor.B
);
//发布
window.DialogResult = true;
WeakReferenceMessenger.Default.Send(colorMessage);
}
}
}
}