diff --git a/README.md b/README.md index cf33099..f203113 100644 --- a/README.md +++ b/README.md @@ -76,33 +76,34 @@ namespace YourNamespace **IMPORTANT:** i suggest to NOT use ```[Xaml.XamlCompilation(Xaml.XamlCompilationOptions.Compile)]``` with HotReload. It can cause errors. So, don't enable it for Debug or disable. ### C# Elements reloading +* **AVAILABLE ON ANDROID AND IOS SIMULATORS**. + +* First of All add ```--enable-repl``` to iOS additional mtouch arguments for iPhone Simulator: + +![alt text](https://github.com/AndreiMisiukevich/HotReload/blob/master/files/enable_repl.png) + * For Reloading C# view you NEED to mark it with an attribute - **[HotReloader.CSharpVisual]**: ```csharp - [HotReloader.CSharpVisual] - public class CodeContentPage : ContentPage - { - private Color _backColor; - - public CodeContentPage(Color backColor) - { - } - } +[HotReloader.CSharpVisual] // Add this attribute +public class CodeContentPage : ContentPage +{ +} ``` **NOTE**: BindingContext will be copied automaticaly, but if your view constructor has any parameters, you will have to implement an interface - **ICsharpRestorable**: ```csharp - [HotReloader.CSharpVisual] - public class CodeContentPage : ContentPage - { - private Color _backColor; - - public CodeContentPage(Color backColor) - { - _backColor = backColor; - BackgroundColor = backColor; - } +[HotReloader.CSharpVisual] +public class CodeContentPage : ContentPage +{ + private Color _backColor; - public object[] ConstructorRestoringParameters => new object[] { _backColor }; //These arguments will be passed in case of reloading + public CodeContentPage(Color backColor) + { + _backColor = backColor; + BackgroundColor = backColor; } + + public object[] ConstructorRestoringParameters => new object[] { _backColor }; //These arguments will be passed in case of reloading +} ``` * ViewModels (BindingContext) can be updated as well. No need to to mark them with any attribute.