Esempio n. 1
0
        private static void OnIsExpandedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            ThemeTreeItem themeTreeItem = (ThemeTreeItem)sender;

            if (!(bool)args.NewValue || themeTreeItem.Parent == null)
            {
                return;
            }
            themeTreeItem.Parent.IsExpanded = true;
        }
Esempio n. 2
0
        public virtual int CompareTo(object obj)
        {
            ThemeTreeItem themeTreeItem = obj as ThemeTreeItem;

            if (themeTreeItem == null)
            {
                return(-1);
            }
            else
            {
                return(this.Name.CompareTo(themeTreeItem.Name));
            }
        }
Esempio n. 3
0
        private static void UpdateVisibility(ThemeModel themeModel, ThemeTreeItem item)
        {
            ThemeItemModel themeItemModel = item as ThemeItemModel;

            if (themeItemModel != null)
            {
                if (themeModel.HideDefaultItems)
                {
                    themeItemModel.Visibility = themeItemModel.IsDefault ? Visibility.Collapsed : Visibility.Visible;
                }
                else
                {
                    themeItemModel.Visibility = Visibility.Visible;
                }
            }
            else
            {
                ThemeItemCategoryModel itemCategoryModel = item as ThemeItemCategoryModel;
                if (itemCategoryModel == null)
                {
                    return;
                }
                foreach (ThemeTreeItem themeTreeItem in (Collection <ThemeTreeItem>)itemCategoryModel.Children)
                {
                    ThemeModel.UpdateVisibility(themeModel, themeTreeItem);
                }
                if (Enumerable.FirstOrDefault <ThemeTreeItem>((IEnumerable <ThemeTreeItem>)itemCategoryModel.Children, (Func <ThemeTreeItem, bool>)(o => o.Visibility != Visibility.Collapsed)) == null)
                {
                    itemCategoryModel.Visibility = Visibility.Collapsed;
                }
                else
                {
                    itemCategoryModel.Visibility = Visibility.Visible;
                }
            }
        }
Esempio n. 4
0
 public override ThemeItemCategoryModel CreateCategory(string name, ThemeTreeItem parent)
 {
     return (ThemeItemCategoryModel)new ImagesCategoryModel(name, parent);
 }
Esempio n. 5
0
 internal ResourceCategoryModel(string name, ThemeTreeItem parent)
     : base(name, parent)
 {
 }
Esempio n. 6
0
 internal ImagesCategoryModel(string name, ThemeTreeItem parent)
     : base(name, parent)
 {
 }
Esempio n. 7
0
 public virtual ThemeItemCategoryModel CreateCategory(string name, ThemeTreeItem parent)
 {
     return new ThemeItemCategoryModel(name, parent);
 }
Esempio n. 8
0
 public virtual ThemeItemCategoryModel CreateCategory(string name, ThemeTreeItem parent)
 {
     return(new ThemeItemCategoryModel(name, parent));
 }
Esempio n. 9
0
 public ThemeItemCategoryModel(string name, ThemeTreeItem parent)
 {
     this.Name     = name;
     this.Parent   = parent;
     this.Children = new ObservableCollection <ThemeTreeItem>();
 }
Esempio n. 10
0
 public ThemeItemCategoryModel(string name, ThemeTreeItem parent)
 {
     this.Name = name;
     this.Parent = parent;
     this.Children = new ObservableCollection<ThemeTreeItem>();
 }
Esempio n. 11
0
 private static void UpdateVisibility(ThemeModel themeModel, ThemeTreeItem item)
 {
     ThemeItemModel themeItemModel = item as ThemeItemModel;
     if (themeItemModel != null)
     {
         if (themeModel.HideDefaultItems)
             themeItemModel.Visibility = themeItemModel.IsDefault ? Visibility.Collapsed : Visibility.Visible;
         else
             themeItemModel.Visibility = Visibility.Visible;
     }
     else
     {
         ThemeItemCategoryModel itemCategoryModel = item as ThemeItemCategoryModel;
         if (itemCategoryModel == null)
             return;
         foreach (ThemeTreeItem themeTreeItem in (Collection<ThemeTreeItem>)itemCategoryModel.Children)
             ThemeModel.UpdateVisibility(themeModel, themeTreeItem);
         if (Enumerable.FirstOrDefault<ThemeTreeItem>((IEnumerable<ThemeTreeItem>)itemCategoryModel.Children, (Func<ThemeTreeItem, bool>)(o => o.Visibility != Visibility.Collapsed)) == null)
             itemCategoryModel.Visibility = Visibility.Collapsed;
         else
             itemCategoryModel.Visibility = Visibility.Visible;
     }
 }
Esempio n. 12
0
 public override ThemeItemCategoryModel CreateCategory(string name, ThemeTreeItem parent)
 {
     return((ThemeItemCategoryModel) new ImagesCategoryModel(name, parent));
 }