<Application x:Class="AdventureWorks.Client.Wpf.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:xom="clr-namespace:Xomega.Framework;assembly=Xomega.Framework.Wpf"
             DispatcherUnhandledException="Application_DispatcherUnhandledException"
             ShutdownMode="OnMainWindowClose">
  <Application.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Xomega.Framework.Wpf;component/Images.xaml"/>
      </ResourceDictionary.MergedDictionaries>
      <Style x:Key="RadioButtonListStyle" TargetType="{x:Type ListBox}">
        <Setter Property="ItemContainerStyle">
          <Setter.Value>
            <Style TargetType="{x:Type ListBoxItem}" >
              <Setter Property="Margin" Value="2" />
              <Setter Property="Template">
                <Setter.Value>
                  <ControlTemplate TargetType="{x:Type ListBoxItem}" >
                    <RadioButton Focusable="False" IsChecked="{Binding Path=IsSelected,
                                 Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
                      <ContentPresenter></ContentPresenter>
                    </RadioButton>
                  </ControlTemplate>
                </Setter.Value>
              </Setter>
            </Style>
          </Setter.Value>
        </Setter>
      </Style>
      <ControlTemplate x:Key="validationTemplate">
        <DockPanel>
          <TextBlock Foreground="Red" Text="*" FontSize="18" FontWeight="Bold"
                         ToolTip="{Binding ElementName=adornerPlaceholder, Path=AdornedElement.(xom:Property.Validation).Errors.ErrorsText}" />
          <AdornedElementPlaceholder Name="adornerPlaceholder"/>
        </DockPanel>
      </ControlTemplate>
      <Style x:Key="ViewTitleStyle" TargetType="{x:Type TextBlock}">
        <Setter Property="FontSize" Value="16"/>
        <Setter Property="FontWeight" Value="Bold"/>
      </Style>
      <Style x:Key="LabelStyle" TargetType="{x:Type Label}">
        <Style.Triggers>
          <Trigger Property="xom:Property.Required" Value="True">
            <Setter Property="FontWeight" Value="Bold"/>
          </Trigger>
        </Style.Triggers>
      </Style>
      <Style x:Key="DataLabelStyle" TargetType="{x:Type TextBlock}">
        <Setter Property="Margin" Value="5"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
      </Style>
      <Style x:Key="OperatorStyle" TargetType="{x:Type ComboBox}">
        <Setter Property="Margin" Value="5"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
      </Style>
      <Style x:Key="ControlStyle" TargetType="{x:Type FrameworkElement}">
        <Setter Property="Margin" Value="5"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource validationTemplate}"/>
      </Style>
      <Style x:Key="CriteriaStyle" TargetType="{x:Type Control}">
        <Setter Property="Margin" Value="5"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource validationTemplate}"/>
      </Style>
    </ResourceDictionary>
  </Application.Resources>
</Application>
