コード例 #1
0
        public DispatcherCoordinatorActor()
        {
            System.Console.WriteLine("DispatcherCoordinatorActor created");

            ActorPathPrinter.Print(Self);

            Receive <NotifyDispatcherCommandCanExecuteChanged>(msg =>
            {
                Context.ActorSelection(ActorPaths.DispatcherCommandNotifier).Tell(msg);
            });

            Receive <PageNavigate>(msg =>
            {
                System.Console.WriteLine("Navigating . . .");
                Context.ActorSelection(ActorPaths.PageNavigator).Tell(msg);
            });
            System.Console.WriteLine("Receiving PageNavigate . . .");

            Receive <PageNavigateBack>(msg =>
            {
                Context.ActorSelection(ActorPaths.PageNavigator).Tell(msg);
            });

            Receive <CreateDispatcherActor>(msg =>
            {
                Context.ActorOf(
                    Props.Create(msg.ActorType, msg.ConstructorParams)
                    .WithDispatcher("akka.actor.synchronized-dispatcher"),
                    msg.ActorName);
            });

            Self.Tell(CreateDispatcherActor.Build <DispatcherCommandNotifierActor>(
                          ActorNames.DispatcherCommandNotifier));
        }
コード例 #2
0
        public PageContainer()
        {
            Action <Page> navigateToPage = SetPage;

            App.UIActors
            .ActorSelection(ActorPaths.DispatcherCoordinator)
            .Tell(CreateDispatcherActor.Build <PageNavigatorActor>(
                      ActorNames.PageNavigator, navigateToPage));
        }