Comet is an MVU UIToolkit written in C#
Перейти к файлу
Sweekriti Satpathy 2a91790c2a Update build-master.yml for Azure Pipelines 2019-07-12 12:21:41 -07:00
build Update build-master.yml for Azure Pipelines 2019-07-12 12:21:41 -07:00
sample Refactored all of the views to match slider. 2019-07-12 12:26:01 -05:00
src bringing back that DevOps 2019-07-12 14:19:32 -05:00
tests/HotUI.Tests Fixed build on windows. 2019-07-11 22:08:29 -05:00
.gitignore Added initial implemention for Android 2019-06-23 21:00:02 -06:00
HotUI.sln Added support for “ViewRepresentable” on iOS 2019-07-11 11:11:38 -05:00
HotUI.sln.DotSettings Work on new approach to handlers to enable overlays, masking and shadows. 2019-07-08 23:52:12 -07:00
LICENSE
README.md

README.md

HotUI

What is Hot UI? It is a new UI Framework/Patern to write app UI. It follows the Model View Update patern. You will notice there is no Databinding defined. It magically databinds for you!

Key Concepts

HotUI is an MVU style patern.

HotPage is a screen It has a build method, this is where you define your UI.

public class MyPage : HotPage{
	protected override View Build () => new Label{Text="Hello World};
}

HotPage is state aware. When the state changes, databinding will automatically update, or rebuild the view if needed.

State

As of right now there are two supported ways to add state. Simmple data types like int, bool? Just add a State field to your HotPage

class MyPage : HotPage{
	State<int> clickCount = new State<int>(1);
}

Do you want to use more complex data types?

For now you need to subclass BindingObject.

public class MainPage : HotPage {
		class MyBindingObject : BindingObject {
			public bool CanEdit {
				get => GetProperty<bool> ();
				set => SetProperty (value);
			}
			public string Text {
				get => GetProperty<string> ();
				set => SetProperty (value);
			}
		}

		[State]
		readonly MyBindingObject state;
}

Soon you can implement an interface.

How do I use the sate?


		readonly State<int> clickCount = new State<int> (1);
		readonly State<string> text = new State<string> ("Hello World");


		protected override View Build () => new Stack {
			new Label {Text = text.Value},
			new Button{Text = "Update Text", OnClick = ()=>{
					text.Value = $"Click Count: {clickCount.Value++}";
				}
			}
		};
	}

That is all!, now when the Text Changes everything updates.

#What if I want to format my value without an extra state property?

While new Label{Text = $"Click Count: {clickCount}" works, it isnt efficient.

You should use Label.TextBinding

public class MyPage : HotPage {

		readonly State<int> clickCount = new State<int> (1);

		protected override View Build () => new Stack {
			new Label {TextBinding = ()=> $"Click Count: {clickCount}" },
			new Button{Text = "Update Text", OnClick = ()=>{
				clickCount.Value++;
				}
			}
		};
	}

What platforms will be supported

  • Xamarin.Forms
  • iOS
  • Android
  • UWP
  • Mac OS

Does this require Xamarin.Forms?

No! You can use the navitve versions, and get lots of native awesomesause!