MVVM - Binding an attached property to ViewModel

Docking/MDI for WPF Forum

Posted 13 years ago by Ulfried
Version: 11.1.0543
Avatar
I sucessfully adapted the Tab-Flashing-Behavior from the samples (which only work with ToolWindows) to work with DocumentWindow too. I use it this way and it works perfect:

<docking:DocumentWindow 
 sample:DocumentWindowTabFlashBehavior.IsFlashing="True"
 sample:DocumentWindowTabFlashBehavior.IsStoppedWhenActivated="False"
 >
...
Now I want to use this with MVVM. I want to bind the attached Property IsFlashing with a Boolean-property from my ViewModel.I tried a lot, but can't get this to work with DocumentItemContainerstyle or DocumentItemTemplate (DataTemplate). If this is somehow possible, I would greatly appreciate a short working sample here.


kind regard
Ulfried

Comments (1)

Posted 13 years ago by Ulfried
Avatar
ok, found the answer by myself, this was only a problem with Style-Syntax for attached properties. This now works for me:

    <Style x:Key="DocumentItemStyle" TargetType="docking:DocumentWindow" >
        <Setter Property="Title" Value="{Binding Title}" />
        <Setter Property="TabTintColor" Value="{Binding TabColor}"/>
        <Setter Property="fstTkCommon:DocumentWindowTabFlashBehavior.IsFlashing" Value="{Binding TabAlert}"/>
    </Style>

Ulfried
The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.