Replies: 1 comment 7 replies
-
Do you have a sample I could look at? One thing you could do is resolve the PushDelegate in a try/catch and see what's invalid. Shiny does usually log this for you. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are using FreshMVVM and it's IOC Container which is using TinyIOC "under the covers".
In the past when I have needed some Shiny classes injected into my FreshMVVM registered ViewModels I have done the following
FreshMvvm.FreshIOC.Container.Register<INotificationManager>(ShinyHost.Resolve<INotificationManager>());
That's worked just fine and now we need the opposite. Access to some of our services within some Shiny delegates such as IPushDelegate. The approach I have taken is to expolicitly call Resolve on the FreshIOC container
var breatheServices = FreshIOC.Container.Resolve<IBreatheServices>(); var clinicalService = FreshIOC.Container.Resolve<IClinicalService>();
Under normal debugging and test scenarios that seems to work but recently I wired up Shiny Logging for AppCenter via the
ShinyStartup.ConfigureLogging
and that highlighted that sometimes those Resolve calls are failing. This makes me think I should be configure the dependencies needed in the Shiny delegates using the correct Shiny process.I added some AddSingleton registration in ShinyStartup.ConfigureServices
public override void ConfigureServices(IServiceCollection services, IPlatform platform)
{
services.UsePush();
services.UseNotifications();
}
And then added the dependencies to the PushDelagate ctor. Now when I run the app I get no errors but the PushDelegate seems to be invalid with none of the breakpoints firing and no System.Diagnostics.Debug.WriteLine outputs appearing in the output window
Have I totally misunderstood how I should get my dependencies into the likes of the PushDelegate?
Is there a way of reusing the FreshMVVM IOC container with Shiny?
We are using FreshMVVM and it's IOC Container which i believe is using TinyIOC.
In the past when I have needed access to some Shiny classes injected into my FreshMVVM registered ViewModels I have done the following
FreshMvvm.FreshIOC.Container.Register<INotificationManager>(ShinyHost.Resolve<INotificationManager>());
That's worked just fine but we need to get access to some of our services within some Shiny delegates such as IPushDelegate. The approach I have taken is to expolicitly call Resolve on the FreshIOC container
var breatheServices = FreshIOC.Container.Resolve<IBreatheServices>(); var clinicalService = FreshIOC.Container.Resolve<IClinicalService>();
Under normal debugging and test scenarios that seems to work but recently I wired up Shiny Logging via the
ShinyStartup.ConfigureLogging
and that highlighted that sometimes those Resolve calls are failing. This makes me think I should be configure the dependencies needed in the Shiny delegates using the correct Shiny process.I add some AddSingleton registration in ShinyStartup.ConfigureServices
public override void ConfigureServices(IServiceCollection services, IPlatform platform)
{
services.UsePush();
services.UseNotifications();
}
And then added the dependencies to the PushDelagate ctor. Now when I run the app I get no errors but the PsuhDelegate seems to be invalid woith none of the breakpoints firing and no System.Diagnostics.Debug.WriteLine outputs appearing in the output window
Beta Was this translation helpful? Give feedback.
All reactions