<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
    xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    xmlns:activity="clr-namespace:System.Windows.Controls;assembly=ActivityControl" 
    x:Class="TaskIt.MainPage"
    mc:Ignorable="d"      
    d:DesignWidth="640" d:DesignHeight="480">

    <UserControl.Resources>
        <Storyboard x:Name="ShowNavigationLinksStoryboard">
            <DoubleAnimation Duration="0:0:0.5" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="NavigationLinksContainer"/>
        </Storyboard>
        <Storyboard x:Name="HideNavigationLinksStoryboard">
            <DoubleAnimation Duration="0:0:0.5" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="NavigationLinksContainer"/>
        </Storyboard>
    </UserControl.Resources>

    <Grid Background="{StaticResource AppBackgroundBrush}">
        <telerik:RadDockPanel>
            <telerik:RadDockPanel Style="{StaticResource HeaderContainerStyle}" telerik:RadDockPanel.Dock="Top">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Width="90">
                    <Path Style="{StaticResource LogoIconStyle}" Data="M102.03442,598.79645 L105.22962,597.78918 L106.78825,600.42358 C106.78825,600.42358 108.51028,595.74304 110.21724,593.60419 C112.00967,591.35822 114.89314,591.42316 114.89314,591.42316 C114.89314,591.42316 112.67844,593.42645 111.93174,594.44464 C110.7449,596.06293 107.15683,604.13837 107.15683,604.13837 z"/>
                    <TextBlock Text="{Binding ResourceTitleApplication}" Style="{StaticResource LogoStyle}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" telerik:RadDockPanel.Dock="Right">
                    <StackPanel x:Name="NavigationLinksContainer" Opacity="0">
                        <HyperlinkButton x:Name="lnkHome" Content="{Binding ResourcePageLinkHome}" NavigateUri="/Home" Style="{StaticResource NavigationLinkStyle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Visibility="{Binding IsInstallCommandAvailable, Converter={StaticResource BooleanToVisibilityConverter}}">
                        <Rectangle Style="{StaticResource StandardSpacerStyle}"/>
                        <HyperlinkButton Content="{Binding ResourceLinkInstall}" Command="{Binding InstallCommand}" Style="{StaticResource NavigationLinkStyle}"/>
                    </StackPanel>
                </StackPanel>
            </telerik:RadDockPanel>
            <Grid Style="{StaticResource PageContainerStyle}" telerik:RadDockPanel.Dock="Bottom">
                <navigation:Frame x:Name="ContentFrame" Source="{Binding NavigateUri, Mode=TwoWay}" Template="{StaticResource NavTransitioningFrame}">
                    <navigation:Frame.UriMapper>
                        <uriMapper:UriMapper>
                            <uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
                            <uriMapper:UriMapping Uri="/{assemblyName};component/{path}" MappedUri="/{assemblyName};component/{path}"/>
                            <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
                        </uriMapper:UriMapper>
                    </navigation:Frame.UriMapper>
                </navigation:Frame>
            </Grid>
        </telerik:RadDockPanel>
        <telerikNavigation:RadWindow x:Name="ValidationErrorWindow" Header="{Binding ResourceTitleValidationErrors}">
            <StackPanel>
                <ItemsControl ItemsSource="{Binding ValidationErrors}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <TextBlock Text="{Binding ErrorContent}"/>
                                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
                <Rectangle Style="{StaticResource StandardSpacerStyle}"/>
                <Button Content="{Binding ResourceCommandOK}" Command="{Binding CloseValidationWindowCommand}" HorizontalAlignment="Left" TabIndex="0"/>
            </StackPanel>
        </telerikNavigation:RadWindow>
        <telerikNavigation:RadWindow x:Name="ValidationResultWindow" Header="{Binding ResourceTitleValidationErrors}">
            <StackPanel>
                <ItemsControl ItemsSource="{Binding ValidationResults}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <TextBlock Text="{Binding ErrorMessage}"/>
                                <Rectangle Style="{StaticResource SmallSpacerStyle}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
                <Rectangle Style="{StaticResource StandardSpacerStyle}"/>
                <Button Content="{Binding ResourceCommandOK}" Command="{Binding CloseValidationWindowCommand}" HorizontalAlignment="Left" TabIndex="0"/>
            </StackPanel>
        </telerikNavigation:RadWindow>
        <telerikNavigation:RadWindow x:Name="ConfirmDeletionWindow" Header="{Binding ResourceTitleConfirmDeletion}">
            <StackPanel>
                <TextBlock Text="{Binding ResourceMessageConfirmDeletion}"/>
                <Rectangle Style="{StaticResource StandardSpacerStyle}"/>
                <StackPanel Orientation="Horizontal">
                    <Button Content="{Binding ResourceCommandOK}" Command="{Binding ExecuteDeleteCommand}"/>
                    <Rectangle Style="{StaticResource StandardSpacerStyle}"/>
                    <Button Content="{Binding ResourceCommandCancel}" Command="{Binding CloseConfirmDeletionWindowCommand}" TabIndex="0"/>
                </StackPanel>
            </StackPanel>
        </telerikNavigation:RadWindow>
        <telerikNavigation:RadWindow x:Name="ErrorWindow" Header="{Binding ResourceTitleError}">
            <StackPanel>
                <TextBlock Text="{Binding ErrorMessage}"/>
                <Rectangle Style="{StaticResource StandardSpacerStyle}"/>
                <StackPanel Orientation="Horizontal">
                    <Button Content="{Binding ResourceCommandClose}" Command="{Binding CloseErrorWindowCommand}" TabIndex="0"/>
                </StackPanel>
            </StackPanel>
        </telerikNavigation:RadWindow>
        <activity:Activity IsActive="{Binding IsOperationInProgress}" ActiveContent="{Binding ResourceMessagePleaseWait}"/>
    </Grid>

</UserControl>