Skip to main content

Announcing Experimental Mobile Blazor Bindings May update

It’s been a few months so it’s time for another update of Experimental Mobile Blazor Bindings! This release brings several bug fixes in the areas of CSS styling support, adding XML doc comments to common APIs, and several syntax improvements to common controls.

Here are the major changes in this release:

  • Update to latest native mobile component versions in Xamarin.Forms 4.5 and add doc comments #96, #110, #111
  • Improve Label and Button syntax #87, #27
  • Fix CSS support for iOS apps #109
  • Breaking change: Use space-separated CSS classes instead of comma-separated #100

Get started

To get started with Experimental Mobile Blazor Bindings preview 3, install the .NET Core 3.1 SDK and then run the following command:

dotnet new -i Microsoft.MobileBlazorBindings.Templates::0.3.26-preview

And then create your first project by running this command:

dotnet new mobileblazorbindings -o MyApp

That’s it! You can find additional docs and tutorials on https://docs.microsoft.com/mobile-blazor-bindings/.

Upgrade an existing project

To update an existing Mobile Blazor Bindings project please refer to the Migrate Mobile Blazor Bindings From Preview 2 to Preview 3 topic for full details.

Updated components and docs

Because most of the components in Mobile Blazor Bindings are based on Xamarin.Forms native controls, the components have been updated to Xamarin.Forms 4.5. For example, properties such as Image.IsAnimationPlaying and Stepper.StepperPosition are now available. The doc comments that are seen in IntelliSense have also been imported so that you get useful help while coding:

Mobile Blazor Bindings IntelliSense docs tooltip

Improve Label and Button syntax

Because one of the key motivators for building Mobile Blazor Bindings was to have patterns that were more familiar to web developers, the syntax for Label and Button components has been simplified and improved.

In previous versions setting the text for a Label’s Span’s Text or a Button’s Text had to be done via a property setter:

<Button Text="Click me" ... />
...
<Button Text="@("Buy " + @items.Count + " items")" ... />

Starting with Preview 3 you can use this simplified syntax that is more similar to web patterns:

<Button ...>Click me</Button>
...
<Button ...>Buy @items.Count items</Button>

This change applies to Button.Text and Span.Text.

Speaking of Span.Text, a Label with complex formatting used to have many intermediate tags:

<Label FontSize="12">
    <FormattedText>
        <FormattedString>
            <Spans>
                <Span Text="This text is large... " FontSize="50" />
                <Span Text="and this is plain... " />
                <Span Text="and this is green!"
                        TextColor="Color.Green" />
            </Spans>
        </FormattedString>
    </FormattedText>
</Label>

And starting with Preview 3, the intermediate tags have all been removed:

<Label FontSize="12">
    <Span FontSize="50">This text is large... </Span>
    <Span>and this is plain... </Span>
    <Span TextColor="Color.Green">and this is green!</Span>
</Label>

CSS improvements

CSS is a great way to style your application while keeping it separate from the layout and behavior. Check out the CSS Styles topic for more information on how to use CSS in your Mobile Blazor Bindings apps.

There are three CSS-related improvements in this release:

  1. The minimum version of Xamarin.Forms is now 4.5, which fixes most CSS issues, such as the ability to use almost all CSS selectors.
  2. A small breaking change was made to use spaces as separators instead of commas when specifying multiple class names (this matches web behavior). See issue #100 for more information.
  3. A bug fix was made to ensure CSS is loaded properly on iOS devices.

More information:

For more information please check out:

Thank you to community blog posts!

If you’d like to learn more, please check out these blog posts from community members:

Thank you!

What’s next? Let us know what you want!

We’re listening to your feedback, which has been both plentiful and helpful! We’re also fixing bugs and adding new features. And you may have seen last week’s announcement for .NET Multi-platform App UI (.NET MAUI). As an experiment, what we find with Mobile Blazor Bindings will feed directly into the Blazor aspects of .NET MAUI so please share with us your thoughts on using Blazor with .NET MAUI on this project’s repo or on .NET MAUI’s GitHub repo.

This project will continue to take shape in large part due to your feedback, so please let us know your thoughts at the GitHub repo.

P.S.: My apologies for the delay in this update. The realities of work-from-home (and stay-at-home parenting) meant that progress was extremely limited. I thank everyone for their patience, understanding, and support. You can always stay up-to-date by going to the GitHub repo and using the latest builds, or reach me on Twitter @original_ejl.

The post Announcing Experimental Mobile Blazor Bindings May update appeared first on ASP.NET Blog.



Comments

Popular posts from this blog

Fake CVR Generator Denmark

What Is Danish CVR The Central Business Register (CVR) is the central register of the state with information on all Danish companies. Since 1999, the Central Business Register has been the authoritative register for current and historical basic data on all registered companies in Denmark. Data comes from the companies' own registrations on Virk Report. There is also information on associations and public authorities in the CVR. As of 2018, CVR also contains information on Greenlandic companies, associations and authorities. In CVR at Virk you can do single lookups, filtered searches, create extracts and subscriptions, and retrieve a wide range of company documents and transcripts. Generate Danish CVR For Test (Fake) Click the button below to generate the valid CVR number for Denmark. You can click multiple times to generate several numbers. These numbers can be used to Test your sofware application that uses CVR, or Testing CVR APIs that Danish Govt provide. Generate

How To Iterate Dictionary Object

Dictionary is a object that can store values in Key-Value pair. its just like a list, the only difference is: List can be iterate using index(0-n) but not the Dictionary . Generally when we try to iterate the dictionary we get below error: " Collection was modified; enumeration operation may not execute. " So How to parse a dictionary and modify its values?? To iterate dictionary we must loop through it's keys or key - value pair. Using keys

How To Append Data to HTML5 localStorage or sessionStorage?

The localStorage property allows you to access a local Storage object. localStorage is similar to sessionStorage. The only difference is that, while data stored in localStorage has no expiration time untill unless user deletes his cache, data stored in sessionStorage gets cleared when the originating window or tab get closed. These are new HTML5 objects and provide these methods to deal with it: The following snippet accesses the current domain's local Storage object and adds a data item to it using Storage.setItem() . localStorage.setItem('myFav', 'Taylor Swift'); or you can use the keyname directly as : localStorage.myFav = 'Taylor Swift'; To grab the value set in localStorage or sessionStorage, we can use localStorage.getItem("myFav"); or localStorage.myFav There's no append function for localStorage or sessionStorage objects. It's not hard to write one though.The simplest solution goes here: But we can kee