예제 #1
0
        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;
        }
예제 #2
0
 public static void SetInjectScoped(DependencyObject obj, DisposeBehaviour value) => obj.SetValue(InjectScopedProperty, value);