<!--================================================================================================
## CommonHelpers satellite library | Author: Sergei Y.Kitáev
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<ResourceDictionary
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:sys="clr-namespace:System;assembly=mscorlib"
   xmlns:userwin="clr-namespace:UserWin">

   <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type userwin:UXWinResources},
                 ResourceId=BusyAsDisabledStyle}" TargetType="{x:Type Control}">
      <Setter Property="IsEnabled">
         <Setter.Value>
            <Binding Path="IsBusy"
                     RelativeSource="{RelativeSource FindAncestor,
                                     AncestorType={x:Type userwin:UXWindow}}">
               <Binding.Converter>
                  <userwin:UXBusyAsFalseConverter />
               </Binding.Converter>
            </Binding>
         </Setter.Value>
      </Setter>
   </Style>

   <Binding x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type userwin:UXWinResources},
                   ResourceId=BusyAsFalseBinding}"
            Path="IsBusy"
            RelativeSource="{RelativeSource FindAncestor,
                            AncestorType={x:Type Window}}">
      <Binding.Converter>
         <userwin:UXBusyAsFalseConverter />
      </Binding.Converter>
   </Binding>

</ResourceDictionary>
