Ensure containers show up in the menu when they are created
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
namespace Toolkit.Foundation;
|
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;
|
namespace Toolkit.Foundation;
|
||||||
|
|
||||||
public interface IContainer<T>
|
public interface IValueStore<T>
|
||||||
{
|
{
|
||||||
T? Value { get; }
|
T? Value { get; }
|
||||||
|
|
||||||
@@ -92,12 +92,13 @@ public partial class ObservableViewModel<TKey, TValue>(IServiceProvider provider
|
|||||||
IMediator mediator,
|
IMediator mediator,
|
||||||
IPublisher publisher,
|
IPublisher publisher,
|
||||||
ISubscriber subscriber,
|
ISubscriber subscriber,
|
||||||
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer)
|
IDisposer disposer,
|
||||||
where TValue : notnull
|
TValue? value = null) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer)
|
||||||
|
where TValue : class
|
||||||
{
|
{
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private TKey? key;
|
private TKey? key;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private TValue? value;
|
private TValue? value = value;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace Toolkit.Foundation;
|
namespace Toolkit.Foundation;
|
||||||
|
|
||||||
public class Container<T> :
|
public class ValueStore<T> :
|
||||||
IContainer<T>
|
IValueStore<T>
|
||||||
{
|
{
|
||||||
public T? Value { get; private set; }
|
public T? Value { get; private set; }
|
||||||
|
|
||||||
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user