<!--================================================================================================
## 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="WaitCursorBusyOverlayRectangleStyle"
          TargetType="{x:Type Rectangle}">
      <Setter Property="Opacity" Value="0" />
      <Setter Property="Fill" Value="#000000" />
      <Setter Property="Cursor" Value="Wait" />
      <!--<Setter Property="ForceCursor" Value="True" />-->
   </Style>

   <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type userwin:UXWinResources},
                        ResourceId=WaitCursorBusyOverlayDataTemplate}">
      <Rectangle Style="{StaticResource WaitCursorBusyOverlayRectangleStyle}"
                 HorizontalAlignment="{x:Static userwin:UXBusyOverlayHelpers.HorizontalAlignment}">
         <Rectangle.Visibility>
            <Binding Path="IsBusy"
                     RelativeSource="{RelativeSource FindAncestor,AncestorType={x:Type Window}}">
               <Binding.Converter>
                  <userwin:UXBusyToOverlayVisibilityConverter />
               </Binding.Converter>
            </Binding>
         </Rectangle.Visibility>
      </Rectangle>
   </DataTemplate>

</ResourceDictionary>
