30 changed files with 533 additions and 84 deletions
@ -0,0 +1,36 @@ |
|||
// Copyright (c) The Perspex Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System; |
|||
using System.Globalization; |
|||
using OmniXaml.TypeConversion; |
|||
using Perspex.Input; |
|||
using Perspex.Media.Imaging; |
|||
using Perspex.Platform; |
|||
|
|||
namespace Perspex.Markup.Xaml.Converters |
|||
{ |
|||
public class CursorTypeConverter : ITypeConverter |
|||
{ |
|||
public bool CanConvertFrom(IXamlTypeConverterContext context, Type sourceType) |
|||
{ |
|||
return sourceType == typeof(string); |
|||
} |
|||
|
|||
public bool CanConvertTo(IXamlTypeConverterContext context, Type destinationType) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
public object ConvertFrom(IXamlTypeConverterContext context, CultureInfo culture, object value) |
|||
{ |
|||
var cursor = (StandardCursorType)Enum.Parse(typeof (StandardCursorType), ((string) value).Trim(), true); |
|||
return new Cursor(cursor); |
|||
} |
|||
|
|||
public object ConvertTo(IXamlTypeConverterContext context, CultureInfo culture, object value, Type destinationType) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
} |
|||
} |
|||
@ -1 +1 @@ |
|||
Subproject commit f2673838c0422ff0f6fdb3e4b34a5302971f59b5 |
|||
Subproject commit 0904dcb07175ca0cdf2ae1fda1434c0f1425a53e |
|||
@ -0,0 +1,17 @@ |
|||
namespace Perspex.Controls |
|||
{ |
|||
|
|||
public enum WindowEdge |
|||
{ |
|||
//Please don't reorder stuff here, I was lazy to write proper conversion code
|
|||
//so the order of values is matching one from GTK
|
|||
NorthWest = 0, |
|||
North, |
|||
NorthEast, |
|||
West, |
|||
East, |
|||
SouthWest, |
|||
South, |
|||
SouthEast, |
|||
} |
|||
} |
|||
Loading…
Reference in new issue