Use spaces to match Ooui

This commit is contained in:
Frank A. Krueger 2017-11-09 13:03:56 -08:00
parent e3627b5b90
commit a887133288
14 changed files with 560 additions and 552 deletions

View File

@ -4,6 +4,13 @@
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType></DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="2.4.0.38779" /> <PackageReference Include="Xamarin.Forms" Version="2.4.0.38779" />
</ItemGroup> </ItemGroup>

View File

@ -103,7 +103,7 @@ namespace Ooui.Forms.Renderers
if (Element == null || Control == null) if (Element == null || Control == null)
return; return;
var uiControl = Control as Ooui.Element; var uiControl = Control as Ooui.FormControl;
if (uiControl == null) if (uiControl == null)
return; return;
uiControl.IsDisabled = !Element.IsEnabled; uiControl.IsDisabled = !Element.IsEnabled;

View File

@ -19,8 +19,9 @@ namespace Ooui.Forms
{ {
readonly ConcurrentDictionary<string, object> values = readonly ConcurrentDictionary<string, object> values =
new ConcurrentDictionary<string, object> (); new ConcurrentDictionary<string, object> ();
#pragma warning disable 67
public event EventHandler<ResourcesChangedEventArgs> ValuesChanged; public event EventHandler<ResourcesChangedEventArgs> ValuesChanged;
#pragma warning restore 67
public bool TryGetValue (string key, out object value) public bool TryGetValue (string key, out object value)
{ {

View File

@ -144,10 +144,11 @@ namespace Ooui.Forms
float newY = visualParent == null ? y : Math.Max (0, (float)(visualParent.Height - y - view.Height)); float newY = visualParent == null ? y : Math.Max (0, (float)(visualParent.Height - y - view.Height));
var target = new Rectangle (x, newY, width, height); var target = new Rectangle (x, newY, width, height);
uiview.Style.Position = "absolute";
uiview.Style.Left = x; uiview.Style.Left = x;
uiview.Style.Top = newY; uiview.Style.Top = newY;
uiview.Style.Width = width; uiview.Style.Right = x + width;
uiview.Style.Height = height; uiview.Style.Bottom = newY + height;
} }
else if (width <= 0 || height <= 0) { else if (width <= 0 || height <= 0) {
return; return;

View File

@ -79,6 +79,7 @@ Global
$1.FileWidth = 128 $1.FileWidth = 128
$1.NoTabsAfterNonTabs = True $1.NoTabsAfterNonTabs = True
$1.scope = text/x-csharp $1.scope = text/x-csharp
$1.TabsToSpaces = True
$0.CSharpFormattingPolicy = $2 $0.CSharpFormattingPolicy = $2
$2.scope = text/x-csharp $2.scope = text/x-csharp
$2.NewLinesForBracesInProperties = False $2.NewLinesForBracesInProperties = False

View File

@ -25,12 +25,6 @@ namespace Ooui
set => SetProperty (ref hidden, value, "hidden"); set => SetProperty (ref hidden, value, "hidden");
} }
bool disabled = false;
public bool IsDisabled {
get => disabled;
set => SetProperty (ref disabled, value, "disabled");
}
public event TargetEventHandler Clicked { public event TargetEventHandler Clicked {
add => AddEventListener ("click", value); add => AddEventListener ("click", value);
remove => RemoveEventListener ("click", value); remove => RemoveEventListener ("click", value);

View File

@ -272,6 +272,11 @@ namespace Ooui
} }
} }
public Value Position {
get => this["position"];
set => this["position"] = value;
}
public Value Right { public Value Right {
get => this["right"]; get => this["right"];
set => this["right"] = value; set => this["right"] = value;
@ -307,8 +312,7 @@ namespace Ooui
set => this["width"] = value; set => this["width"] = value;
} }
public Value this [string propertyName] public Value this[string propertyName] {
{
get { get {
lock (properties) { lock (properties) {
Value p; Value p;