public void InheritFrom(WindowSettingsViewModel parent)
 {
     InheritProperties = true;
     MinWindowScale    = parent.MinWindowScale;
     MaxWindowScale    = parent.MaxWindowScale;
     DefaultWidth      = parent.DefaultWidth;
     DefaultHeight     = parent.DefaultHeight;
     ShrinkToContent   = parent.ShrinkToContent;
     HasDropShadow     = parent.HasDropShadow;
     DropShadowOpacity = parent.DropShadowOpacity;
     DropShadowColor   = parent.DropShadowColor;
     BackgroundColor   = parent.BackgroundColor;
 }
Пример #2
0
        public ContentItemViewModel(ContentItem model)
            : base(model)
        {
            MenuSelectedItemBus = EventBusManager.Instance.GetOrCreateBus(nameof(MenuSelectedItemBus));
            WindowSettings      = new WindowSettingsViewModel(Model.WindowSettings);

            var lst = new List <ContentItemViewModel>();

            foreach (var item in model.Children)
            {
                var vm = CreateItem(item);
                vm.Parent = this;

                if (item.WindowSettings.InheritProperties)
                {
                    vm.WindowSettings.InheritFrom(WindowSettings);
                }

                lst.Add(vm);
            }

            _children = new ViewModelCollection <ContentItemViewModel, ContentItem>(Model.Children, lst);
        }