Esempio n. 1
0
        private PUTabItem GenerateTabItem(PUTabItemModel model)
        {
            var tabItem = new PUTabItem()
            {
                Header  = model.Header,
                Content = model.Content,
                Height  = model.Height,
                Icon    = model.Icon,
                Value   = model.Value,
                DeleteButtonVisibility = model.CanDelete ? Visibility.Visible : Visibility.Collapsed,
            };

            if (Items.Count == 0)
            {
                tabItem.IsSelected = true;
            }

            model.PropertyChanged += delegate
            {
                tabItem.Header  = model.Header;
                tabItem.Content = model.Content;
                tabItem.Height  = model.Height;
                tabItem.Icon    = model.Icon;
                tabItem.Value   = model.Value;
                tabItem.DeleteButtonVisibility = model.CanDelete ? Visibility.Visible : Visibility.Collapsed;
            };

            return(tabItem);
        }
Esempio n. 2
0
        private PUTabItem GenerateTabItem(PUTabItemModel model)
        {
            var tabItem = new PUTabItem()
            {
                Uid       = model.Uid,
                Header    = model.Header,
                Content   = model.Content,
                Height    = model.Height,
                Icon      = model.Icon,
                Value     = model.Value,
                CanDelete = model.CanDelete,
            };

            if (Items.Count == 0)
            {
                tabItem.IsSelected = true;
            }

            model.PropertyChanged += delegate
            {
                tabItem.Header    = model.Header;
                tabItem.Content   = model.Content;
                tabItem.Height    = model.Height;
                tabItem.Icon      = model.Icon;
                tabItem.Value     = model.Value;
                tabItem.CanDelete = model.CanDelete;
            };

            return(tabItem);
        }