예제 #1
0
        // methods

        public void SetFilter()
        {
            // Activate default settings (system wide)


            // get active button
            RadioButton _activeRadio = FilterButtons.Where(a => a.IsChecked == true).Single();

            string name = _activeRadio.Name.Replace("btnControl", "").ToLower();

            /*
             *
             * // set system specific config panels as visible
             * foreach (Border border in AllDynamicControlPanels)
             * {
             *  string brdName = StripTrailingNumerals(border.Name.ToLower().Replace("controlbrd", ""));
             *  if (brdName == name || (name == "base"))
             *  {
             *      border.Visibility = Visibility.Visible;
             *  }
             *  else
             *  {
             *      border.Visibility = Visibility.Collapsed;
             *  }
             * }
             */
        }
예제 #2
0
        public void SetFilter()
        {
            // Activate default settings (system wide)


            // get active button
            RadioButton _activeRadio = FilterButtons.Where(a => a.IsChecked == true).Single();

            string name = _activeRadio.Name.Replace("btnConfig", "").ToLower();


            // set system specific config panels as visible
            foreach (Border border in AllDynamicConfigPanels)
            {
                string brdName = StripTrailingNumerals(border.Name.ToLower().Replace("brdspecific", ""));
                if (brdName == name || (name == "base" && GS.showAllBaseSettings == true))
                {
                    border.Visibility = Visibility.Visible;
                }
                else
                {
                    border.Visibility = Visibility.Collapsed;
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Constructor, activates on page/frame load
        /// </summary>
        public CustomerViewModel()
        {
            if (IsInDesignMode)
            {
                return;
            }

            // Loaded Data from WebApi
            var items = Global.Articles.FindAll(ArticleIsActive);

            // One nav Button for The "Hem"-knapp
            FilterButtons.Add(new FilterButton {
                Type = "Hem"
            });

            foreach (var item in items)
            {
                // Storage, used for filtering later on
                storedArticles.Add(new ArticleItemDataModel(item));

                // Displayed Articles
                Articles.Add(new ArticleItemDataModel(item));

                // Create nav buttons for each type once
                if (FilterButtons.Where(fb => fb.Type == item.Type).Count() < 1)
                {
                    FilterButtons.Add(new FilterButton {
                        Type = item.Type
                    });
                }
            }

            // ...
            RunAsyncActions();
        }
        private void OnFilterButtonSelected(FilterTag filterTag)
        {
            filterTag.IsSelected = !filterTag.IsSelected;
            bool isJitEnabled   = FilterButtons.Any(x => x.IsJit && x.IsSelected);
            var  selectedFilter = FilterButtons.Where(x => x.IsSelected).Select(x => x.Tag).ToList();

            System.Diagnostics.Debug.WriteLine($"Filtet Button Tapped : {filterTag.IsSelected}");
            if (filterTag.Tag.Equals(FilterButtonText))
            {
                // Navigate on Filter screen.
                _navigationService.NavigateToAsync(Enums.PageKey.Filter);
            }
            else
            {
                FiltereList(selectedFilter, isJitEnabled);
            }
        }
예제 #5
0
        public void SetFilter()
        {
            // get active button
            RadioButton _activeRadio = FilterButtons.Where(a => a.IsChecked == true).Single();

            string name = _activeRadio.Name.Replace("btn", "");

            // get all borders that have names that match the above string
            string        brdName  = "brd" + name;
            List <Border> _borders = (from b in AllSettingPanels
                                      where b.Name.Contains(brdName)
                                      select b).ToList();

            if (name == "AllSettings")
            {
                // all settings - show all
                foreach (Border b in AllSettingPanels)
                {
                    b.Visibility = Visibility.Visible;
                    if (b.Name == "MednafenPaths" || b.Name == "SystemBios")
                    {
                        b.Visibility = Visibility.Collapsed;
                    }
                }
            }
            else
            {
                // active the border boxes relating to this filter button and deactivate the rest
                List <Border> newList = new List <Border>();
                newList = AllSettingPanels.ToList();

                foreach (Border b in _borders)
                {
                    // set visibility visible
                    b.Visibility = Visibility.Visible;
                    // remove from AllSettingsPanels
                    newList.Remove(b);
                }
                foreach (Border b in newList)
                {
                    // set visibility collapsed
                    b.Visibility = Visibility.Collapsed;
                }
            }
        }