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

@ -33,15 +33,15 @@ namespace Ooui.Forms
_renderer = new PlatformRenderer (this); _renderer = new PlatformRenderer (this);
} }
void IDisposable.Dispose() void IDisposable.Dispose ()
{ {
if (_disposed) if (_disposed)
return; return;
_disposed = true; _disposed = true;
MessagingCenter.Unsubscribe<Page, ActionSheetArguments>(this, Page.ActionSheetSignalName); MessagingCenter.Unsubscribe<Page, ActionSheetArguments> (this, Page.ActionSheetSignalName);
MessagingCenter.Unsubscribe<Page, AlertArguments>(this, Page.AlertSignalName); MessagingCenter.Unsubscribe<Page, AlertArguments> (this, Page.AlertSignalName);
MessagingCenter.Unsubscribe<Page, bool>(this, Page.BusySetSignalName); MessagingCenter.Unsubscribe<Page, bool> (this, Page.BusySetSignalName);
} }
public static IVisualElementRenderer CreateRenderer (VisualElement element) public static IVisualElementRenderer CreateRenderer (VisualElement element)
@ -68,9 +68,9 @@ namespace Ooui.Forms
base.OnBindingContextChanged (); base.OnBindingContextChanged ();
} }
public SizeRequest GetNativeSize(VisualElement view, double widthConstraint, double heightConstraint) public SizeRequest GetNativeSize (VisualElement view, double widthConstraint, double heightConstraint)
{ {
return new SizeRequest(new Size(100, 100)); return new SizeRequest (new Size (100, 100));
} }
public void SetPage (Page newRoot) public void SetPage (Page newRoot)

View File

@ -5,7 +5,7 @@ namespace Ooui.Forms.Renderers
{ {
public class ButtonRenderer : ViewRenderer<Xamarin.Forms.Button, Ooui.Button> public class ButtonRenderer : ViewRenderer<Xamarin.Forms.Button, Ooui.Button>
{ {
public ButtonRenderer() public ButtonRenderer ()
{ {
} }
} }

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;