private void ucAccessoryStates_ItemStateChanged(object sender, ItemEventArgs e)
 {
     // note: ucAccessoryStates control doesn't fire this event when IsInteractive == false;
     // add only if it's not within recent (to prevent jumping)
     if (!AppManager.EcosModel.AccessoryManager.RecentItemsIDs.Contains(e.Item.ID))
         AppManager.AddRecentItem(e.Item);
 }
        private void ucFeedbackModulesList_ItemClicked(object sender, ItemEventArgs e)
        {
            FeedbackModule item = e.Item as FeedbackModule;

            AppManager.EcosModel.FeedbackManager.SelectedItem = item;

            Frame.Navigate(typeof(FeedbackModulePage));
        }
 private void FeedbackManager_ItemRemoved(object sender, ItemEventArgs e)
 {
     if (NavigationService.CurrentSource == new Uri("/FeedbackModulePage.xaml", UriKind.Relative) && e.Item == FeedbackModule)
     {
         MessageBox.Show(Labels.ItemDeleted + FeedbackModule.Name, App.Name, MessageBoxButton.OK);
         NavigationService.GoBack();
     }
 }
 private void AccessoryManager_ItemRemoved(object sender, ItemEventArgs e)
 {
     if (NavigationService.CurrentSource == new Uri("/AccessoryPage.xaml", UriKind.Relative) && e.Item == Accessory)
     {
         MessageBox.Show(Labels.ItemDeleted + Accessory.NameText, App.Name, MessageBoxButton.OK);
         NavigationService.GoBack();
     }
 }
 private async void FeedbackManager_ItemRemoved(object sender, ItemEventArgs e)
 {
     if (Frame.CurrentSourcePageType == typeof(FeedbackModulePage) && e.Item == FeedbackModule)
     {
         await Utils.MessageBox(Labels.ItemDeleted + FeedbackModule.Name);
         NavigationHelper.GoBack();
     }
 }
 private async void AccessoryManager_ItemRemoved(object sender, ItemEventArgs e)
 {
     if (Frame.CurrentSourcePageType == typeof(AccessoryPage) && e.Item == Accessory)
     {
         await Utils.MessageBox(Labels.ItemDeleted + Accessory.NameText);
         NavigationHelper.GoBack();
     }
 }
        //private void btnAdd_Click(object sender, EventArgs e)
        //{
        //    App.EcosModel.LocomotivesManager.AppendCreated();
        //}
        private void ucLocos_ItemTapped(object sender, ItemEventArgs e)
        {
            Locomotive item = e.Item as Locomotive;

            App.AddRecentItem(item);
            App.EcosModel.LocomotivesManager.SelectedItem = item;

            NavigationService.Navigate(new Uri("/LocomotivePage.xaml", UriKind.Relative));
        }
        private void listAccessories_ItemClicked(object sender, ItemEventArgs e)
        {
            Accessory item = e.Item as Accessory;

            AppManager.AddRecentItem(item);
            //App.EcosModel.AccessoryManager.SelectedItem = item;

            //Frame.Navigate(typeof(AccessoryPage));
        }
        private void listLocos_ItemClicked(object sender, ItemEventArgs e)
        {
            Locomotive item = e.Item as Locomotive;

            AppManager.AddRecentItem(item);
            AppManager.EcosModel.LocomotiveManager.SelectedItem = item;

            Frame.Navigate(typeof(LocomotivePage));
        }
        private void ucSensors_ItemTapped(object sender, ItemEventArgs e)
        {
            FeedbackModule item = e.Item as FeedbackModule;

            //App.AddRecentItem(item);
            App.EcosModel.FeedbackManager.SelectedItem = item;

            (Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/FeedbackModulePage.xaml", UriKind.Relative));
        }
 private void lbCheckAccessories_ItemUnchecked(object sender, ItemEventArgs e)
 {
     if (Collection.AccessoriesIDs.Contains(e.Item.ID))
         Collection.AccessoriesIDs.Remove(e.Item.ID);
 }
 private void lbCheckLocomotives_ItemUnchecked(object sender, ItemEventArgs e)
 {
     if (Collection.LocomotivesIDs.Contains(e.Item.ID))
         Collection.LocomotivesIDs.Remove(e.Item.ID);
 }
 private void LocomotiveManager_ItemRemoved(object sender, ItemEventArgs e)
 {
     if (IDs != null && IDs.Contains(e.Item.ID))
         IDs.Remove(e.Item.ID);
 }
 private void lvCheckAccessories_ItemChecked(object sender, ItemEventArgs e)
 {
     if (!Collection.AccessoriesIDs.Contains(e.Item.ID))
         Collection.AccessoriesIDs.Add(e.Item.ID);
 }
        private void lvCheckLocomotives_ItemUnchecked(object sender, ItemEventArgs e)
        {
            if (Collection.LocomotivesIDs.Contains(e.Item.ID))
                Collection.LocomotivesIDs.Remove(e.Item.ID);

            AppManager.SaveProfiles();
        }