protected InjectedUserControl(DisposeBehaviour behavior = DisposeBehaviour.OnDispatcherShutdown, bool createScope = true) { Scope = CompositionRoot.ServiceProvider is not null ? CompositionRoot.ServiceProvider.GetRequiredService <IInjecter>().InjectIntoType(GetType(), this, createScope) : null; Behavior = behavior; Loaded += OnControlLoaded; }
public static void SetInjectScoped(DependencyObject obj, DisposeBehaviour value) => obj.SetValue(InjectScopedProperty, value);