NewFilePopup.xaml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <Window x:Class="PixiEditor.Views.NewFilePopup"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PixiEditor.Views"
  7. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  8. xmlns:vm="clr-namespace:PixiEditor.ViewModels"
  9. xmlns:helpers="clr-namespace:PixiEditor.Helpers.Behaviours"
  10. mc:Ignorable="d"
  11. d:DesignHeight="600" d:DesignWidth="450" DataContext="{DynamicResource NewFileMenuViewModel}" WindowStyle="None" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Height="600" Width="450" Name="newFilePopup">
  12. <Window.Resources>
  13. <vm:NewFileMenuViewModel x:Key="NewFileMenuViewModel"/>
  14. </Window.Resources>
  15. <Grid Background="#303030">
  16. <Grid.RowDefinitions>
  17. <RowDefinition Height="25*"/>
  18. <RowDefinition Height="577*"/>
  19. </Grid.RowDefinitions>
  20. <Grid Grid.Row="0" Background="#FF2C2C2C">
  21. <i:Interaction.Triggers>
  22. <i:EventTrigger EventName="MouseDown">
  23. <i:InvokeCommandAction Command="{Binding DragMoveCommand}"/>
  24. </i:EventTrigger>
  25. </i:Interaction.Triggers>
  26. <Button Width="20" Height="20" VerticalAlignment="Top" HorizontalAlignment="Right" BorderThickness="0" Command="{Binding CloseCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
  27. <Button.Background>
  28. <ImageBrush ImageSource="/Images/Cross.png" Stretch="Uniform"/>
  29. </Button.Background>
  30. </Button>
  31. </Grid>
  32. <StackPanel HorizontalAlignment="Center" Margin="0,50,0,0" Background="#FF2E2E2E" VerticalAlignment="Top" Grid.Row="1" Width="350" Height="150">
  33. <DockPanel Margin="50,35,0,0">
  34. <TextBlock Height="30" Foreground="Snow" Text="Height:" TextAlignment="Center" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  35. <TextBox Height="30" Width="150" Style="{StaticResource DarkTextBoxStyle}" FontSize="16" HorizontalAlignment="Left" TextAlignment="Center" Margin="5,0,0,0" Text="{Binding ElementName=newFilePopup, Path=FileHeight, Mode=TwoWay}" MaxLength="4">
  36. <i:Interaction.Behaviors>
  37. <helpers:AllowableCharactersTextBoxBehavior RegularExpression="^[0-9./-]+$" MaxLength="4"/>
  38. </i:Interaction.Behaviors>
  39. </TextBox>
  40. </DockPanel>
  41. <DockPanel Margin="50,10,0,0">
  42. <TextBlock Height="30" Foreground="Snow" Text="Width:" TextAlignment="Center" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  43. <TextBox Height="30" Width="150" Style="{StaticResource DarkTextBoxStyle}" FontSize="16" HorizontalAlignment="Left" Margin="10,0,0,0" TextAlignment="Center" Text="{Binding ElementName=newFilePopup, Path=FileWidth, Mode=TwoWay}" MaxLength="4">
  44. <i:Interaction.Behaviors>
  45. <helpers:AllowableCharactersTextBoxBehavior RegularExpression="^[0-9./-]+$" MaxLength="4"/>
  46. </i:Interaction.Behaviors>
  47. </TextBox>
  48. </DockPanel>
  49. </StackPanel>
  50. <Button VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="20" Height="30" Width="60" Style="{StaticResource DarkRoundButton}" Content="OK" Margin="0,0,10,10" Grid.Row="1" Command="{Binding OkCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
  51. </Grid>
  52. </Window>