Sick Gaming
Announcing Experimental Mobile Blazor Bindings - Printable Version

+- Sick Gaming (https://www.sickgaming.net)
+-- Forum: Programming (https://www.sickgaming.net/forum-76.html)
+--- Forum: C#, Visual Basic, & .Net Frameworks (https://www.sickgaming.net/forum-79.html)
+--- Thread: Announcing Experimental Mobile Blazor Bindings (/thread-93163.html)



Announcing Experimental Mobile Blazor Bindings - xSicKxBot - 01-15-2020

Announcing Experimental Mobile Blazor Bindings

<div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/01/announcing-experimental-mobile-blazor-bindings.png" width="150" height="150" title="" alt="" /></div><div><div class="row justify-content-center">
<div class="col-md-4">
<div><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/01/announcing-experimental-mobile-blazor-bindings.png" width="58" height="58" alt="Eilon Lipton" class="avatar avatar-58 wp-user-avatar wp-user-avatar-58 alignnone photo"></p>
<p>Eilon</p>
</div>
</div>
</div>
<div class="entry-meta">
<p>January 14th, 2020</p>
</p></div>
<p><!-- .entry-meta --> </p>
<p>Today I’m excited to announce a new experimental project to enable native mobile app development with Blazor: Experimental Mobile Blazor Bindings. These bindings enable developers to build native mobile apps using C# and .NET for iOS and Android using familiar web programming patterns. This means you can use the Blazor programming model and Razor syntax to define UI components and behaviors of an application. The UI components that are included are based on Xamarin.Forms native UI controls, which results in beautiful native mobile apps.</p>
<p>Here is a sample Counter component, which may look familiar to Blazor developers, that increments a value on each button press:</p>
<pre><code class="xml">&lt;StackLayout&gt; &lt;Label FontSize="30" Text="@("You pressed " + count + " times")" /&gt; &lt;Button Text="+1" OnClick="@HandleClick" /&gt;
&lt;/StackLayout&gt; @code { int count; void HandleClick() { count++; }
}
</code></pre>
<p>Notice that the Blazor model is present with code sitting side by side the user interface markup that leverages Razor syntax with mobile specific components. This will feel very natural for any web developer that has ever used Razor syntax in the past. Now with the Experimental Mobile Blazor Bindings you can leverage your existing web skills and knowledge to build native iOS and Android apps powered by .NET.</p>
<p>Here is the code above running in the Android Emulator:</p>
<p><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/01/announcing-experimental-mobile-blazor-bindings.gif" alt="Clicking increment button in Android emulator" width="300" height="533" class="aligncenter size-full wp-image-23061"></p>
<h2>Get started with Mobile Blazor Bindings</h2>
<p>To get started, all you need is the <a href="https://dotnet.microsoft.com/download">.NET Core 3.0 or 3.1 SDK</a>, Visual Studio or Visual Studio for Mac, and the ASP.NET and web development and Mobile development with .NET (Xamarin.Forms) workloads installed.</p>
<p>Install the templates by running this command from a command/shell window:</p>
<pre><code class="shell">dotnet new -i Microsoft.MobileBlazorBindings.Templates::0.1.173-beta
</code></pre>
<p>And then create your first project by running this command:</p>
<pre><code class="shell">dotnet new mobileblazorbindings -o MyApp
</code></pre>
<p>Open the solution (SLN file) in Visual Studio and mark either the Android or iOS project as the StartUp Project, which should look like this:</p>
<p><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/01/announcing-experimental-mobile-blazor-bindings-1.png" alt="VS solution with shared UI, Android, and iOS projects" width="373" height="296" class="aligncenter size-full wp-image-23063"></p>
<p>Now run your first Mobile Blazor Bindings app in a local emulator or on an attached mobile device! Don’t have one set up yet for development? No worries, the Xamarin documentation has all the details for you here:</p>
<p>For documentation and walkthroughs, check out the <a href="https://docs.microsoft.com/mobile-blazor-bindings/">Mobile Blazor Bindings documentation</a>.</p>
<h2>Why Mobile Blazor Bindings now?</h2>
<p>Many developers delight in using XAML and Xamarin.Forms to craft beautiful native mobile apps. We have heard from a set of developers that come from a web programming background that having web specific patterns to build mobile applications would be ideal for them. The goal of these bindings is to see if developers would like to have the option of writing markup and doing data binding for native mobile applications using the Blazor-style programming model with Razor syntax and features. Would you love to see this option in the box for future versions of Visual Studio?</p>
<h2>Learn more</h2>
<p>To learn more about Experimental Mobile Blazor Bindings, please check out these resources:</p>
<h2>Give feedback</h2>
<p>Please send us your feedback via issues in our GitHub repo and by completing a short survey about your experience and expectations.</p>
<p>We hope you try out this new framework and let us know your thoughts!</p>
<div class="authorinfoarea">
<div><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/01/announcing-experimental-mobile-blazor-bindings.png" width="96" height="96" alt="Eilon Lipton" class="avatar avatar-96 wp-user-avatar wp-user-avatar-96 alignnone photo"></div>
</p></div>
</div>


https://www.sickgaming.net/blog/2020/01/14/announcing-experimental-mobile-blazor-bindings/