<Window x:Class="WpfDisplay.Views.WelcomeWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:WpfDisplay.Views"
xmlns:vm="clr-namespace:WpfDisplay.ViewModels"
xmlns:conv="clr-namespace:WpfDisplay.Converters"
xmlns:app="clr-namespace:WpfDisplay"
xmlns:disp="clr-namespace:IFSEngine.WPF.InteractiveDisplay;assembly=IFSEngine.WPF.InteractiveDisplay"
Style="{StaticResource MaterialDesignWindow}"
TextElement.FontWeight="Regular"
TextElement.FontSize="16"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignDarkBackground}"
FontFamily="{DynamicResource MaterialDesignFont}"
WindowStartupLocation="CenterOwner"
ShowInTaskbar="False"
WindowStyle="ToolWindow"
mc:Ignorable="d"
Title="Welcome"
Height="650" Width="600"
MinHeight="650" MinWidth="600"
x:Name="welcomeWindow"
d:DataContext="{d:DesignInstance Type=vm:WelcomeViewModel, IsDesignTimeCreatable=False}"
AllowDrop="True" DragOver="welcomeWindow_DragOver" Drop="welcomeWindow_Drop">
<Window.CommandBindings>
<CommandBinding Command="ApplicationCommands.Paste" Executed="Paste_Executed" CanExecute="Paste_CanExecute"/>
</Window.CommandBindings>
<Window.Resources>
<DataTemplate x:Key="thumbnailTemplate">
<Button
Width="100" Height="100" Margin="4"
Command="{Binding DataContext.SelectExploreWorkflowCommand, ElementName=welcomeWindow}"
CommandParameter="{Binding Key}"
ToolTip="{Binding Key.Title}" BorderThickness="0">
<Button.Background>
<ImageBrush
ImageSource="{Binding Value}"
Stretch="UniformToFill">
<ImageBrush.RelativeTransform>
<ScaleTransform ScaleY="-1" CenterY="0.5"/>
</ImageBrush.RelativeTransform>
</ImageBrush>
</Button.Background>
</Button>
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Image Stretch="UniformToFill" Source="/IFSRenderer;component/Resources/featured_artwork.jpg"/>
<TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="8" FontSize="14">
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="2"/>
</TextBlock.Effect>
<Hyperlink NavigateUri="https://art.z97.io/" Foreground="White">
Artwork <md:PackIcon Kind="ExternalLink"/>
</Hyperlink>
</TextBlock>
<Label VerticalAlignment="Bottom" IsHitTestVisible="False" Margin="8" FontSize="48" FontFamily="{StaticResource MaterialDesignFont}">
<Label.Effect>
<DropShadowEffect/>
</Label.Effect>
IFSRenderer
</Label>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Top" Margin="8">
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="2"/>
</TextBlock.Effect>
<Hyperlink NavigateUri="https://github.com/bezo97/IFSRenderer/releases" Foreground="White">
<Run Text="{x:Static app:App.VersionString}"/> <md:PackIcon Kind="ExternalLink"/>
</Hyperlink>
</TextBlock>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<md:Card Grid.Column="0" Padding="4" Margin="2 4">
<StackPanel MinWidth="200">
<Label>Choose a workflow</Label>
<StackPanel Margin="8,0">
<TextBlock Margin="0,4">
<Hyperlink Command="{Binding SelectWorkflowCommand}" CommandParameter="{x:Static vm:WelcomeWorkflow.FromScratch}">
Start from scratch
</Hyperlink>
</TextBlock>
<TextBlock Margin="0,4">
<Hyperlink Command="{Binding SelectWorkflowCommand}" CommandParameter="{x:Static vm:WelcomeWorkflow.ShowFileDialog}">
Load file...
</Hyperlink>
</TextBlock>
<TextBlock Margin="0,4">
<Hyperlink Command="{Binding SelectWorkflowCommand}" CommandParameter="{x:Static vm:WelcomeWorkflow.BrowseRandoms}">
Browse randoms...
</Hyperlink>
</TextBlock>
</StackPanel>
<Grid Width="100" Height="100" Margin="16" HorizontalAlignment="Center">
<Grid.Effect>
<DropShadowEffect ShadowDepth="1"/>
</Grid.Effect>
<Button
Width="100" Height="100"
Command="{Binding SelectExploreWorkflowCommand}"
BorderThickness="1">
<Button.Background>
<ImageBrush
ImageSource="{Binding ExploreThumbnail}"
Stretch="UniformToFill">
<ImageBrush.RelativeTransform>
<ScaleTransform ScaleY="-1" CenterY="0.5"/>
</ImageBrush.RelativeTransform>
</ImageBrush>
</Button.Background>
</Button>
<Label VerticalAlignment="Bottom" HorizontalAlignment="Right" IsHitTestVisible="False" FontSize="14">
<Label.Effect>
<DropShadowEffect/>
</Label.Effect>
▷ Explore this
</Label>
</Grid>
</StackPanel>
</md:Card>
<Grid Grid.Column="1" Margin="2 4">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Expander Header="Getting Started" Grid.Row="0" md:ExpanderAssist.HorizontalHeaderPadding="4"
IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource parameterEqualityToBoolConverter}, ConverterParameter=0}">
<md:Card Padding="2">
<StackPanel Margin="8">
<TextBlock>
<Hyperlink NavigateUri="https://github.com/bezo97/IFSRenderer/wiki/Getting-Started-Guide">
Getting Started Guide <md:PackIcon Kind="ExternalLink"/>
</Hyperlink>
</TextBlock>
<TextBlock>
<Hyperlink NavigateUri="https://github.com/bezo97/IFSRenderer/wiki">
Wiki <md:PackIcon Kind="ExternalLink"/>
</Hyperlink>
</TextBlock>
<TextBlock>
<Hyperlink Command="{Binding SelectWorkflowCommand}" CommandParameter="{x:Static vm:WelcomeWorkflow.VisitSettings}">
Visit Settings ⚙️
</Hyperlink>
</TextBlock>
</StackPanel>
</md:Card>
</Expander>
<Expander Header="Templates" Grid.Row="1" md:ExpanderAssist.HorizontalHeaderPadding="4"
IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource parameterEqualityToBoolConverter}, ConverterParameter=1}">
<md:Card Padding="2">
<ScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding Templates}" Padding="0,0,0,4"
ItemTemplate="{StaticResource thumbnailTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</md:Card>
</Expander>
<Expander Header="Recent Files" Grid.Row="2" md:ExpanderAssist.HorizontalHeaderPadding="4"
IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource parameterEqualityToBoolConverter}, ConverterParameter=2}">
<md:Card Padding="2">
<ScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding RecentFiles}" Padding="0,0,0,4"
ItemTemplate="{StaticResource thumbnailTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</md:Card>
</Expander>
</Grid>
</Grid>
<Grid Grid.Row="2" Margin="4">
<Button Command="{Binding ContinueCommand}" IsDefault="True" HorizontalAlignment="Center" Margin="4">Continue</Button>
<CheckBox Command="{Binding DisableStartupCommand}"
IsChecked="True" VerticalAlignment="Bottom" HorizontalAlignment="Right">
Show on startup
</CheckBox>
</Grid>
</Grid>
</Window>