Ensure containers show up in the menu when they are created

This commit is contained in:
TheXamlGuy
2024-05-12 17:09:59 +01:00
parent 4171a31f85
commit 5292896e13
6 changed files with 33 additions and 8 deletions
+8 -1
View File
@@ -1,3 +1,10 @@
namespace Toolkit.Foundation;
public record Activated;
public record Activated<TValue>(TValue? Value = default);
public record Activated
{
public static Activated<TValue> As<TValue>(TValue value) => new(value);
public static Activated<TValue> As<TValue>() where TValue : new() => new(new TValue());
}
@@ -20,6 +20,6 @@ public class ConfigurationInitializer<TConfiguration>(IConfigurationReader<TConf
}
}
await publisher.PublishUI(new Changed<TConfiguration>(configuration));
await publisher.PublishUI(new Activated<TConfiguration>(configuration));
}
}
@@ -1,6 +1,6 @@
namespace Toolkit.Foundation;
public interface IContainer<T>
public interface IValueStore<T>
{
T? Value { get; }
+4 -3
View File
@@ -92,12 +92,13 @@ public partial class ObservableViewModel<TKey, TValue>(IServiceProvider provider
IMediator mediator,
IPublisher publisher,
ISubscriber subscriber,
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer)
where TValue : notnull
IDisposer disposer,
TValue? value = null) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer)
where TValue : class
{
[ObservableProperty]
private TKey? key;
[ObservableProperty]
private TValue? value;
private TValue? value = value;
}
@@ -1,7 +1,7 @@
namespace Toolkit.Foundation;
public class Container<T> :
IContainer<T>
public class ValueStore<T> :
IValueStore<T>
{
public T? Value { get; private set; }
+17
View File
@@ -0,0 +1,17 @@
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Toolkit.UI.Controls;
public class AttachedFlyout : PopupFlyoutBase
{
protected override Control CreatePresenter()
{
throw new NotImplementedException();
}
}