Ejemplo n.º 1
0
        public BfAFactions()
        {
            InitializeComponent();

            BindingContext  = viewModel = new FactionsViewModel();
            viewModel.Xpac  = "BFA";
            viewModel.Title = "Battle for Azeroth";
        }
        public LegionFactions()
        {
            InitializeComponent();

            BindingContext  = viewModel = new FactionsViewModel();
            viewModel.Xpac  = "Legion";
            viewModel.Title = "Legion";

            MessagingCenter.Subscribe <ActiveEmissariesMessage>(this, "ActiveEmissariesMessage", message =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    MockDataStore dataStore = new MockDataStore();
                    dataStore.UpdateEmissaries(message.ActiveEmissaries);
                    //if you already have the next 3 emissaries active and none is expiring today, finish the service
                    if (MockDataStore.factions.Where(f => f.ExpireOn.Date == DateTime.Now.Date).Count() == 0 &&
                        MockDataStore.factions.Where(f => f.ExpireOn.Date != DateTime.MinValue).Count() > 2)
                    {
                        MessagingCenter.Send(new StopWowheadParse(), "StopWowheadParse");
                    }
                    viewModel.LoadFactionsCommand.Execute(null);
                });
            });
        }