alexeyzimarev / ReactiveUI.Autofac

Autofac adapter for ReactiveUI
4 stars 4 forks source link

View registration does not use ViewContractAttribute #1

Closed itabaev closed 7 years ago

itabaev commented 7 years ago

Views:

public partial class FooView : UserControl, IViewFor<IFooViewModel>
{
}

[ViewContract("Header")]
public partial class FooHeaderView : UserControl, IViewFor<IFooViewModel>
{
}

[ViewContract("Header")] is not working. I have to register a view for the "Header" contract:

Locator.CurrentMutable.Register<IViewFor<IFooViewModel>>(() => new FooHeaderView(), "Header");

How to automatically register a views with contracts?

alexeyzimarev commented 7 years ago

Unfortunately, I currently have no support for these attributes. PR is welcomed of course if you want and can fix it :)

alexeyzimarev commented 7 years ago

Thanks for the PR! :) Can you try the dev package and confirm that it works as expected? https://www.myget.org/feed/az-github/package/nuget/ReactiveUI.Autofac

itabaev commented 7 years ago

Works with reactiveui 6.5.2. Since version 7.0.0, the Contract property of the attribute has become internal :(

alexeyzimarev commented 7 years ago

Shall I ask them about it, to consider opening it back?

itabaev commented 7 years ago

If it's not hard for you. I will be grateful :)

alexeyzimarev commented 7 years ago

https://github.com/reactiveui/ReactiveUI/issues/1440

alexeyzimarev commented 7 years ago

@itabaev do you want me to publish a new release package or shall I wait to clarify the issue with RxUI 7 first?

itabaev commented 7 years ago

I use RxUI 7 in my project. So we can wait. Thanks!

alexeyzimarev commented 7 years ago

https://github.com/alexeyzimarev/ReactiveUI/commit/f968a461982acf541f00bb2ebb67fcf76081182c