These are chat archives for ButchersBoy/Dragablz

12th
Jun 2016
Ethan Smith
@ethanhs
Jun 12 2016 20:10
@ButchersBoy I am trying to figure out the NewItemFactory. I have NewItemFactory="{Binding TabFactory}" in my xaml tag for the dragablzcontrol
    public Func<HeaderedItemViewModel> TabFactory
    {
        get
        {
            return
                () =>
                {
                    return new HeaderedItemViewModel() {Header = "New"};
                };
        }
    }
that is my code-behind
Yet it seems to be saying that it can't find the NewItemFactory
James Willock
@ButchersBoy
Jun 12 2016 20:12
Probably because that binding works against DataContext, not the code behind.
Ethan Smith
@ethanhs
Jun 12 2016 20:13
Sorry, not very good with WPF, so I need to add this to a datacontext?
James Willock
@ButchersBoy
Jun 12 2016 20:14
You could just set the property in code behind, or bind to the parent user control self, via a RelativeSource FindAncestor binding. Not on my computer right now but there are examples on SO for binding to user control properties.
or yes, if you have a data context/view model put it in there
Ethan Smith
@ethanhs
Jun 12 2016 20:16
ok, thanks. I will probably go the simpler route
Also, it seems that if I set ItemContainerStyle, I am unable to change an individual tab's style... even if I null the style in xaml or code-behind.
Is there a way to work around that?