<UserControl x:Class="Tango.Scripting.IDE.ScriptIDEView2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Tango.Scripting.IDE"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:controls="clr-namespace:Tango.Scripting.IDE.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:ScriptIDEViewVM, IsDesignTimeCreatable=False}" x:Name="control">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/DarkThemesColors.xaml"/>
<ResourceDictionary Source="Themes/Shared.xaml"/>
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
</ResourceDictionary>
</UserControl.Resources>
<Grid Background="{DynamicResource Background.Static}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" ></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Menu Grid.Row="0" HorizontalAlignment="Stretch" Margin="2,0,0,0" Style="{DynamicResource TangoMenuStyle}" BorderBrush="Transparent">
<MenuItem Header="File">
<MenuItem Header="New">
<MenuItem Header="New Project..." Command="{Binding NewProjectCommand}">
<MenuItem.#region Header
//
// Project: WriteableBitmapEx - WriteableBitmap extensions
// Description: Collection of extension methods for the WriteableBitmap class.
//
// Changed by: $Author: unknown $
// Changed on: $Date: 2015-07-20 11:44:36 +0200 (Mo, 20 Jul 2015) $
// Changed in: $Revision: 114480 $
// Project: $URL: https://writeablebitmapex.svn.codeplex.com/svn/trunk/Source/WriteableBitmapEx/WriteableBitmapShapeExtensions.cs $
// Id: $Id: WriteableBitmapShapeExtensions.cs 114480 2015-07-20 09:44:36Z unknown $
//
//
// Copyright © 2009-2015 Rene Schulte and WriteableBitmapEx Contributors
//
// This code is open source. Please read the License.txt for details. No worries, we won't sue you! ;)
//
#endregion
using System;
#if NETFX_CORE
namespace Windows.UI.Xaml.Media.Imaging
#else
namespace System.Windows.Media.Imaging
#endif
{
/// <summary>
/// Collection of extension methods for the WriteableBitmap class.
/// </summary>
internal
#if WPF
unsafe
#endif
static partial class WriteableBitmapExtensions
{
#region Methods
#region Draw Shapes
#region Polyline, Triangle, Quad
/// <summary>
/// Draws a polyline. Add the first point also at the end of the array if the line should be closed.
/// </summary>
/// <param name="bmp">The WriteableBitmap.</param>
/// <param name="points">The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).</param>
/// <param name="color">The color for the line.</param>
internal static void DrawPolyline(this WriteableBitmap bmp, int[] points, Color color)
{
var col = ConvertColor(color);
bmp.DrawPolyline(points, col);
}
/// <summary>
/// Draws a polyline anti-aliased. Add the first point also at the end of the array if the line should be closed.
/// </summary>
/// <param name="bmp">The WriteableBitmap.</param>
/// <param name="points">The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).</param>
/// <param name="color">The color for the line.</param>
internal static void DrawPolyline(this WriteableBitmap bmp, int[] points, int color)
{
using (var context = bmp.GetBitmapContext())
{
// Use refs for faster access (really important!) speeds up a lot!
var w = context.Width;
var h = context.Height;
var x1 = points[0];
var y1 = points[1];
for (var i = 2; i < points.Length; i += 2)
{
var x2 = points[i];
var y2 = points[i + 1];
DrawLine(context, w, h, x1, y1, x2, y2, color);
x1 = x2;
y1 = y2;
}
}
}
/// <summary>
/// Draws a polyline. Add the first point also at the end of the array if the line should be closed.
/// </summary>
/// <param name="bmp">The WriteableBitmap.</param>
/// <param name="points">The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).</param>
/// <param name="color">The color for the line.</param>
internal static void DrawPolylineAa(this WriteableBitmap bmp, int[] points, Color color)
{
var col = ConvertColor(color);
bmp.DrawPolylineAa(points, col);
}
/// <summary>
/// Draws a polyline anti-aliased. Add the first point also at the end of the array if the line should be closed.
/// </summary>
/// <param name="bmp">The WriteableBitmap.</param>
/// <param name="points">The points of the polyline in x and y pairs, therefore the array is interpreted as (x1, y1, x2, y2, ..., xn, yn).</param>
/// <param name="color">The color for the line.</param>
internal static void DrawPolylineAa(this WriteableBitmap bmp, int[] points, int color)
{
using (var context = bmp.GetBitmapContext())
{
// Use refs for f