Advertisement
IvanYankov

App.xaml

Apr 19th, 2018
2,175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MXML 28.05 KB | None | 0 0
  1. <Application x:Class="FrontEndTask.App"
  2.             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.             xmlns:telerik1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
  5.             StartupUri="MainWindow.xaml">
  6.     <Application.Resources>
  7.         <ResourceDictionary>
  8.             <ResourceDictionary.MergedDictionaries>
  9.                 <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml" />
  10.                 <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml" />
  11.             </ResourceDictionary.MergedDictionaries>
  12.  
  13.             <!-- Creating the default CheckBox style - Displays circle path, when state is unchecked -->
  14.             <Style x:Key="DefaultCheckBoxStyle" TargetType="CheckBox">
  15.                 <Setter Property="Background" Value="{telerik1:Office2013Resource ResourceKey=MainBrush}" />
  16.                 <Setter Property="BorderBrush" Value="{telerik1:Office2013Resource ResourceKey=HighDarkBrush}" />
  17.                 <Setter Property="Foreground" Value="{telerik1:Office2013Resource ResourceKey=InvertedBrush}" />
  18.                 <Setter Property="FontFamily" Value="{telerik1:Office2013Resource ResourceKey=FontFamily}" />
  19.                 <Setter Property="Padding" Value="6 2" />
  20.                 <Setter Property="FontSize" Value="{telerik1:Office2013Resource ResourceKey=FontSizeL}" />
  21.                 <Setter Property="BorderThickness" Value="1" />
  22.                 <Setter Property="HorizontalContentAlignment" Value="Left" />
  23.                 <Setter Property="VerticalContentAlignment" Value="Center" />
  24.                 <Setter Property="SnapsToDevicePixels" Value="True" />
  25.                 <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  26.                 <Setter Property="Validation.ErrorTemplate">
  27.                     <Setter.Value>
  28.                         <ControlTemplate>
  29.                             <Grid Width="14" HorizontalAlignment="Left">
  30.                                 <AdornedElementPlaceholder x:Name="Holder" />
  31.                                 <Grid Width="13" Height="13" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="1 0 0 0">
  32.                                     <Border BorderBrush="{telerik1:Office2013Resource ResourceKey=ValidationBrush}"
  33.                                            BorderThickness="1" SnapsToDevicePixels="True" />
  34.                                     <Path Data="M0,0 L10,0 10,10 z"
  35.                                          Fill="{telerik1:Office2013Resource ResourceKey=ValidationBrush}"
  36.                                          HorizontalAlignment="Right"
  37.                                          VerticalAlignment="Top"
  38.                                          Width="7"
  39.                                          Height="7"
  40.                                          Stretch="Fill"
  41.                                          SnapsToDevicePixels="True" />
  42.                                 </Grid>
  43.                                 <ToolTipService.ToolTip>
  44.                                     <ToolTip x:Name="PART_ToolTip"
  45.                                             DataContext="{Binding RelativeSource={RelativeSource Mode=Self}, Path=PlacementTarget.DataContext}"
  46.                                             Template="{StaticResource ErrorTooltipTemplate}"
  47.                                             Placement="Right" />
  48.                                 </ToolTipService.ToolTip>
  49.                             </Grid>
  50.                         </ControlTemplate>
  51.                     </Setter.Value>
  52.                 </Setter>
  53.                 <Setter Property="Template">
  54.                     <Setter.Value>
  55.                         <ControlTemplate TargetType="CheckBox">
  56.                             <Grid x:Name="Root" Background="Transparent">
  57.                                 <VisualStateManager.VisualStateGroups>
  58.                                     <VisualStateGroup x:Name="CommonStates">
  59.                                         <VisualState x:Name="Normal" />
  60.                                         <VisualState x:Name="MouseOver">
  61.                                             <Storyboard>
  62.                                                 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="normal"
  63.                                                                               Storyboard.TargetProperty="Stroke">
  64.                                                     <DiscreteObjectKeyFrame KeyTime="0"
  65.                                                                            Value="{telerik1:Office2013Resource ResourceKey=AccentMainBrush}" />
  66.                                                 </ObjectAnimationUsingKeyFrames>
  67.                                                 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckVisual"
  68.                                                                               Storyboard.TargetProperty="Stroke">
  69.                                                     <DiscreteObjectKeyFrame KeyTime="0"
  70.                                                                            Value="{telerik1:Office2013Resource ResourceKey=InvertedBrush}" />
  71.                                                 </ObjectAnimationUsingKeyFrames>
  72.                                                 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateVisual"
  73.                                                                               Storyboard.TargetProperty="Stroke">
  74.                                                     <DiscreteObjectKeyFrame KeyTime="0"
  75.                                                                            Value="{telerik1:Office2013Resource ResourceKey=InvertedBrush}" />
  76.                                                 </ObjectAnimationUsingKeyFrames>
  77.                                                 <ObjectAnimationUsingKeyFrames Duration="0:0:0"
  78.                                                                               Storyboard.TargetName="Layer"
  79.                                                                               Storyboard.TargetProperty="Fill">
  80.                                                     <DiscreteObjectKeyFrame KeyTime="0:0:0"
  81.                                                                            Value="{telerik1:Office2013Resource ResourceKey=AccentMainBrush}" />
  82.                                                 </ObjectAnimationUsingKeyFrames>
  83.                                                 <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Layer"
  84.                                                                               Storyboard.TargetProperty="Opacity">
  85.                                                     <LinearDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
  86.                                                 </DoubleAnimationUsingKeyFrames>
  87.                                             </Storyboard>
  88.                                         </VisualState>
  89.                                         <VisualState x:Name="Pressed">
  90.                                             <Storyboard>
  91.                                                 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="normal"
  92.                                                                               Storyboard.TargetProperty="Stroke">
  93.                                                     <DiscreteObjectKeyFrame KeyTime="0"
  94.                                                                            Value="{telerik1:Office2013Resource ResourceKey=AccentMainBrush}" />
  95.                                                 </ObjectAnimationUsingKeyFrames>
  96.                                                 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckVisual"
  97.                                                                               Storyboard.TargetProperty="Stroke">
  98.                                                     <DiscreteObjectKeyFrame KeyTime="0"
  99.                                                                            Value="{telerik1:Office2013Resource ResourceKey=InvertedBrush}" />
  100.                                                 </ObjectAnimationUsingKeyFrames>
  101.                                                 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateVisual"
  102.                                                                               Storyboard.TargetProperty="Stroke">
  103.                                                     <DiscreteObjectKeyFrame KeyTime="0"
  104.                                                                            Value="{telerik1:Office2013Resource ResourceKey=InvertedBrush}" />
  105.                                                 </ObjectAnimationUsingKeyFrames>
  106.                                                 <ObjectAnimationUsingKeyFrames Duration="0:0:0"
  107.                                                                               Storyboard.TargetName="Layer"
  108.                                                                               Storyboard.TargetProperty="Fill">
  109.                                                     <DiscreteObjectKeyFrame KeyTime="0:0:0"
  110.                                                                            Value="{telerik1:Office2013Resource ResourceKey=AccentMainBrush}" />
  111.                                                 </ObjectAnimationUsingKeyFrames>
  112.                                                 <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Layer"
  113.                                                                               Storyboard.TargetProperty="Opacity">
  114.                                                     <LinearDoubleKeyFrame KeyTime="00:00:00" Value="0.5" />
  115.                                                 </DoubleAnimationUsingKeyFrames>
  116.                                             </Storyboard>
  117.                                         </VisualState>
  118.                                         <VisualState x:Name="Disabled">
  119.                                             <Storyboard>
  120.                                                 <DoubleAnimation Duration="0" To="1"
  121.                                                                 Storyboard.TargetProperty="Opacity"
  122.                                                                 Storyboard.TargetName="DisabledVisualElement" />
  123.                                                 <DoubleAnimation Duration="0"
  124.                                                                 To="0.3"
  125.                                                                 Storyboard.TargetProperty="Opacity"
  126.                                                                 Storyboard.TargetName="Content" />
  127.                                             </Storyboard>
  128.                                         </VisualState>
  129.                                     </VisualStateGroup>
  130.                                     <VisualStateGroup x:Name="CheckStates">
  131.                                         <VisualState x:Name="Unchecked" />
  132.                                         <VisualState x:Name="Checked">
  133.                                             <Storyboard>
  134.                                                 <DoubleAnimation To="0"
  135.                                                                 Duration="0"
  136.                                                                 Storyboard.TargetName="UncheckVisual"
  137.                                                                 Storyboard.TargetProperty="(UIElement.Opacity)" />
  138.                                                 <DoubleAnimation To="1"
  139.                                                                 Duration="0"
  140.                                                                 Storyboard.TargetName="CheckVisual"
  141.                                                                 Storyboard.TargetProperty="(UIElement.Opacity)" />
  142.                                             </Storyboard>
  143.                                         </VisualState>
  144.                                         <VisualState x:Name="Indeterminate">
  145.                                             <Storyboard>
  146.                                                 <DoubleAnimation To="0"
  147.                                                                 Duration="0"
  148.                                                                 Storyboard.TargetName="UncheckVisual"
  149.                                                                 Storyboard.TargetProperty="(UIElement.Opacity)" />
  150.                                                 <DoubleAnimation To="1"
  151.                                                                 Duration="0"
  152.                                                                 Storyboard.TargetName="IndeterminateVisual"
  153.                                                                 Storyboard.TargetProperty="(UIElement.Opacity)" />
  154.                                             </Storyboard>
  155.                                         </VisualState>
  156.                                     </VisualStateGroup>
  157.                                     <VisualStateGroup x:Name="FocusStates">
  158.                                         <VisualState x:Name="Unfocused" />
  159.                                         <VisualState x:Name="Focused">
  160.                                             <Storyboard>
  161.                                                 <DoubleAnimation To="1"
  162.                                                                 Duration="0"
  163.                                                                 Storyboard.TargetName="FocusVisual"
  164.                                                                 Storyboard.TargetProperty="(UIElement.Opacity)" />
  165.                                             </Storyboard>
  166.                                         </VisualState>
  167.                                     </VisualStateGroup>
  168.                                 </VisualStateManager.VisualStateGroups>
  169.                                 <Grid.ColumnDefinitions>
  170.                                     <ColumnDefinition Width="Auto" />
  171.                                     <ColumnDefinition Width="*" />
  172.                                 </Grid.ColumnDefinitions>
  173.                                 <Grid x:Name="grid" Margin="1" Width="13" Height="13">
  174.                                     <Rectangle x:Name="normal" Stroke="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}" />
  175.                                     <Path x:Name="UncheckVisual"
  176.                                          Stretch="Fill"
  177.                                          FlowDirection="LeftToRight"
  178.                                          Stroke="{telerik1:Office2013Resource ResourceKey=StrongBrush}"
  179.                                          Data="M24.5,12.5 C24.5,19.127417 19.127417,24.5 12.5,24.5 C5.872583,24.5 0.5,19.127417 0.5,12.5 C0.5,5.872583 5.872583,0.5 12.5,0.5 C19.127417,0.5 24.5,5.872583 24.5,12.5 z"
  180.                                          StrokeThickness="1.5"
  181.                                          HorizontalAlignment="Center"
  182.                                          VerticalAlignment="Center"
  183.                                          Width="8"
  184.                                          Height="8"
  185.                                          Opacity="1" />
  186.                                     <Border x:Name="DisabledVisualElement"
  187.                                            BorderThickness="{TemplateBinding BorderThickness}"
  188.                                            Background="{TemplateBinding Background}"
  189.                                            BorderBrush="{telerik1:Office2013Resource ResourceKey=MediumDarkBrush}"
  190.                                            IsHitTestVisible="False"
  191.                                            Opacity="0" />
  192.                                     <Rectangle x:Name="Layer" Fill="{TemplateBinding Background}" Opacity="0" />
  193.                                     <Path x:Name="CheckVisual"
  194.                                          Stretch="Fill"
  195.                                          FlowDirection="LeftToRight"
  196.                                          Stroke="{telerik1:Office2013Resource ResourceKey=StrongBrush}"
  197.                                          Data="M31.809448,76.327779 L35.056467,80.098168 39.880954,71.832455"
  198.                                          StrokeThickness="1.5"
  199.                                          HorizontalAlignment="Center"
  200.                                          VerticalAlignment="Center"
  201.                                          Width="9"
  202.                                          Height="7"
  203.                                          Opacity="0" />
  204.                                     <Path x:Name="IndeterminateVisual"
  205.                                          Stroke="{telerik1:Office2013Resource ResourceKey=StrongBrush}"
  206.                                          FlowDirection="LeftToRight"
  207.                                          Stretch="Fill"
  208.                                          Data="M14.708333,144.5 L20.667,144.5"
  209.                                          Width="9"
  210.                                          StrokeThickness="2"
  211.                                          VerticalAlignment="Center"
  212.                                          Opacity="0" />
  213.                                     <Rectangle x:Name="FocusVisual"
  214.                                               Stroke="{telerik1:Office2013Resource ResourceKey=AccentMainBrush}" Opacity="0" />
  215.                                 </Grid>
  216.                                 <ContentPresenter x:Name="Content"
  217.                                                  Grid.Column="1"
  218.                                                  Margin="{TemplateBinding Padding}"
  219.                                                  RecognizesAccessKey="True"
  220.                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  221.                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  222.                             </Grid>
  223.                         </ControlTemplate>
  224.                     </Setter.Value>
  225.                 </Setter>
  226.             </Style>
  227.  
  228.             <!-- Setting the default CheckBox style to our custom style -->
  229.             <Style BasedOn="{StaticResource DefaultCheckBoxStyle}" TargetType="CheckBox" />
  230.            
  231.             <!-- Custom RadListBoxItem style - Hover animations; Lime selection color -->
  232.             <Style x:Key="FadingLimeRadListBoxItemStyle" BasedOn="{StaticResource RadListBoxItemStyle}" TargetType="telerik1:RadListBoxItem">
  233.                 <Setter Property="Foreground" Value="{telerik1:VisualStudio2013Resource ResourceKey=MarkerBrush}" />
  234.                 <Setter Property="MinHeight" Value="22" />
  235.                 <Setter Property="Padding" Value="4 3" />
  236.                 <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  237.                 <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  238.                 <Setter Property="VerticalContentAlignment" Value="Top" />
  239.                 <Setter Property="BorderThickness" Value="1" />
  240.                 <Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
  241.                 <Setter Property="Template">
  242.                     <Setter.Value>
  243.                         <ControlTemplate TargetType="telerik1:RadListBoxItem">
  244.                             <Grid>
  245.                                 <VisualStateManager.VisualStateGroups>
  246.                                     <VisualStateGroup x:Name="CommonStates">
  247.                                         <VisualState x:Name="Normal">
  248.                                             <Storyboard>
  249.                                                 <DoubleAnimation Duration="0:0:0.5"
  250.                                                                 To="0"
  251.                                                                 Storyboard.TargetProperty="Opacity"
  252.                                                                 Storyboard.TargetName="MouseOverBorder" />
  253.                                             </Storyboard>
  254.                                         </VisualState>
  255.                                         <VisualState x:Name="MouseOver">
  256.                                             <Storyboard>
  257.                                                 <DoubleAnimation Duration="0:0:0.5"
  258.                                                                 To="1" Storyboard.TargetProperty="Opacity"
  259.                                                                 Storyboard.TargetName="MouseOverBorder" />
  260.                                             </Storyboard>
  261.                                         </VisualState>
  262.                                         <VisualState x:Name="Disabled">
  263.                                             <Storyboard>
  264.                                                 <DoubleAnimation Duration="0" To="0.2"
  265.                                                                 Storyboard.TargetProperty="Opacity"
  266.                                                                 Storyboard.TargetName="contentPresenter" />
  267.                                             </Storyboard>
  268.                                         </VisualState>
  269.                                     </VisualStateGroup>
  270.                                     <VisualStateGroup x:Name="SelectionStates">
  271.                                         <VisualState x:Name="Unselected"/>
  272.                                         <VisualState x:Name="Selected">
  273.                                             <Storyboard>
  274.                                                 <ObjectAnimationUsingKeyFrames Duration="0"
  275.                                                                               Storyboard.TargetName="contentPresenter"
  276.                                                                               Storyboard.TargetProperty="Foreground">
  277.                                                     <DiscreteObjectKeyFrame KeyTime="0"
  278.                                                                            Value="{telerik1:VisualStudio2013Resource ResourceKey=SelectedBrush}" />
  279.                                                 </ObjectAnimationUsingKeyFrames>
  280.                                                 <ObjectAnimationUsingKeyFrames Duration="0:0:0"
  281.                                                                               Storyboard.TargetName="SelectedBorder"
  282.                                                                               Storyboard.TargetProperty="Visibility">
  283.                                                     <DiscreteObjectKeyFrame KeyTime="0:0:0">
  284.                                                         <DiscreteObjectKeyFrame.Value>
  285.                                                             <Visibility>Visible</Visibility>
  286.                                                         </DiscreteObjectKeyFrame.Value>
  287.                                                     </DiscreteObjectKeyFrame>
  288.                                                 </ObjectAnimationUsingKeyFrames>
  289.                                             </Storyboard>
  290.                                         </VisualState>
  291.                                     </VisualStateGroup>
  292.                                     <VisualStateGroup x:Name="FocusStates">
  293.                                         <VisualState x:Name="Focused">
  294.                                             <Storyboard>
  295.                                                 <DoubleAnimation Duration="0"
  296.                                                                 To="1"
  297.                                                                 Storyboard.TargetProperty="Opacity"
  298.                                                                 Storyboard.TargetName="FocusVisual" />
  299.                                             </Storyboard>
  300.                                         </VisualState>
  301.                                         <VisualState x:Name="Unfocused" />
  302.                                     </VisualStateGroup>
  303.                                 </VisualStateManager.VisualStateGroups>
  304.                                 <Border x:Name="Border"
  305.                                                Background="{TemplateBinding Background}"
  306.                                                BorderBrush="{TemplateBinding BorderBrush}"
  307.                                                BorderThickness="{TemplateBinding BorderThickness}"
  308.                                                SnapsToDevicePixels="True" />
  309.                                 <Border x:Name="MouseOverBorder"
  310.                                        Opacity="0"
  311.                                        Background="{telerik1:VisualStudio2013Resource ResourceKey=MouseOverBrush}"/>
  312.                                 <Border x:Name="SelectedBorder" Background="Lime" Visibility="Collapsed" SnapsToDevicePixels="True" />
  313.                                 <ContentControl x:Name="contentPresenter"
  314.                                                Margin="{TemplateBinding Padding}"
  315.                                                Foreground="{TemplateBinding Foreground}"
  316.                                                IsTabStop="False"
  317.                                                ContentTemplate="{TemplateBinding ContentTemplate}"
  318.                                                Content="{TemplateBinding Content}"
  319.                                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  320.                                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  321.                                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
  322.                                                ContentStringFormat="{TemplateBinding ContentStringFormat}" />
  323.                                 <Border x:Name="FocusVisual"
  324.                                        Opacity="0"
  325.                                        BorderThickness="1"
  326.                                        BorderBrush="{telerik1:VisualStudio2013Resource ResourceKey=AccentMainBrush}"
  327.                                        SnapsToDevicePixels="True" />
  328.                             </Grid>
  329.                         </ControlTemplate>
  330.                     </Setter.Value>
  331.                 </Setter>
  332.             </Style>
  333.            
  334.             <!-- Custom RadListBox style - Displays items as checkboxes, using the FadingLimeRadListBoxItemStyle -->
  335.             <Style x:Key="CheckedRadListBoxStyle" BasedOn="{StaticResource RadListBoxStyle}" TargetType="telerik1:RadListBox">
  336.                 <Setter Property="ItemTemplate">
  337.                     <Setter.Value>
  338.                         <DataTemplate DataType="telerik1:RadListBoxItem">
  339.                             <CheckBox Content="{Binding}"
  340.                                      IsChecked="{Binding RelativeSource={RelativeSource AncestorType=telerik1:RadListBoxItem}, Path=IsSelected}">
  341.                                 <CheckBox.Style>
  342.                                     <Style BasedOn="{StaticResource DefaultCheckBoxStyle}" TargetType="CheckBox">
  343.                                         <Style.Triggers>
  344.                                             <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=telerik1:RadListBoxItem}, Path=IsSelected}"
  345.                                                         Value="True">
  346.                                                 <Setter Property="FontWeight" Value="Bold" />
  347.                                                 <Setter Property="FontStyle" Value="Italic" />
  348.                                             </DataTrigger>
  349.                                         </Style.Triggers>
  350.                                     </Style>
  351.                                 </CheckBox.Style>
  352.                             </CheckBox>
  353.                         </DataTemplate>
  354.                     </Setter.Value>
  355.                 </Setter>
  356.                 <Setter Property="ItemContainerStyle" Value="{StaticResource FadingLimeRadListBoxItemStyle}" />
  357.             </Style>
  358.         </ResourceDictionary>
  359.     </Application.Resources>
  360. </Application>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement