Toolbelt.Blazor.TwitterShareButton 7.0.0.31

A Tweet Button component  for Blazor.

Install-Package Toolbelt.Blazor.TwitterShareButton -Version 7.0.0.31
dotnet add package Toolbelt.Blazor.TwitterShareButton --version 7.0.0.31
<PackageReference Include="Toolbelt.Blazor.TwitterShareButton" Version="7.0.0.31" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Toolbelt.Blazor.TwitterShareButton --version 7.0.0.31
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Blazor Tweet Button NuGet Package

Summary

A Tweet Button component for Blazor.

This component supports both server-side Blazor Server App and client-side Blazor WebAssembly App.

How to install and use?

1. Installation and Registration

Step.1-1 Install the library via NuGet package, like this.

>  dotnet add package Toolbelt.Blazor.TwitterShareButton

Step.1-2 Open namespace, like this.

// _Imports.razor
...
@using Toolbelt.Blazor.TwitterShareButton

2. Usage in your Blazor component (.razor)

You can use TwitterShareButton component.

If you implement your component like this,

<TwitterShareButton 
  Text="@($"Current Count is {currentCount}")"
  Size="Large">
</TwitterShareButton>

Then you will get this.

fig.1

Appendix - bundled support JavaScript

TwitterShareButton component automatically inject a reference of the support JavaScript file which is bundled with this NuGet package into &lt;head&gt; element of the current document.

The support JavaScript file is deployed at the URL "_content/Toolbelt.Blazor.TwitterShareButton/script.js".

If you want to disable this behavior, you can configure it in one of the following ways:

a. "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component

You can disable automatic injection of a reference of the support JavaScript file by "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component.

If you set to false the "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component, the "TwitterShareButton" doesn't inject a reference of the support JavaScript file.

<TwitterShareButton Text="..."
  DisableClientScriptAutoInjection="false">
</TwitterShareButton>

b. Configure global options for "TwitterShareButton" at "Startup" class

You can also disable automatic injection of a reference of the support JavaScript file by configure global options for "TwitterShareButton" at "Startup" class, like this.

...
using Toolbelt.Blazor.Extensions.DependencyInjection; // <- Add this...

public class Startup
{
  public void ConfigureServices(IServiceCollection services)
  {
    // ...and add flollow lines.
    services.AddTwitterShareButtonGlobalOptions(options =>
    {
       options.DisableClientScriptAutoInjection = false;
    });
   ...

Note

(a)

Disabling "automatic injection" by configure global options way is more high priority than the "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component.

If you configure global options "DisableClientScriptAutoInjection" to be true, then "automatic injection" never work even if set the "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component to false explicity.

(b)

If you disable "automatic injection", Adding a reference to the support JavaScript file is a responsibility of you.

For example, you can do it by editing "index.html" and add &lt;script&gt; tag statically like following:

<!DOCTYPE html>
<html>
<head>
  ...
  <script src="_content/Toolbelt.Blazor.TwitterShareButton/script.js"></script>

Release Note

  • v.7.0.0
    • Support Server-side Blazor Server app.
    • Made automatic injection of a reference of the support file is configurable.
  • v.6.0.0 - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 9 (not compatible with v.3.0.0 Preview 8 or before.)
  • v.5.0.0 - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 8 (not compatible with v.3.0.0 Preview 4 or before.)
  • v.4.0.0 - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 4 (not compatible with v.0.9.0 or before.)
  • v.3.0.0 - BREAKING CHANGE: Support Blazor v.0.9.0 (not compatible with v.0.8.0 or before.)
  • v.2.0.0 - BREAKING CHANGE: Support Blazor v.0.8.0 (not compatible with v.0.7.0 or before.)
  • v.1.0.1 - Suppressed the flicker that occurs when parameters are updated.
  • v.1.0.0 - 1st release.

License

Mozilla Public License Version 2.0

Blazor Tweet Button NuGet Package

Summary

A Tweet Button component for Blazor.

This component supports both server-side Blazor Server App and client-side Blazor WebAssembly App.

How to install and use?

1. Installation and Registration

Step.1-1 Install the library via NuGet package, like this.

>  dotnet add package Toolbelt.Blazor.TwitterShareButton

Step.1-2 Open namespace, like this.

// _Imports.razor
...
@using Toolbelt.Blazor.TwitterShareButton

2. Usage in your Blazor component (.razor)

You can use TwitterShareButton component.

If you implement your component like this,

<TwitterShareButton 
  Text="@($"Current Count is {currentCount}")"
  Size="Large">
</TwitterShareButton>

Then you will get this.

fig.1

Appendix - bundled support JavaScript

TwitterShareButton component automatically inject a reference of the support JavaScript file which is bundled with this NuGet package into &lt;head&gt; element of the current document.

The support JavaScript file is deployed at the URL "_content/Toolbelt.Blazor.TwitterShareButton/script.js".

If you want to disable this behavior, you can configure it in one of the following ways:

a. "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component

You can disable automatic injection of a reference of the support JavaScript file by "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component.

If you set to false the "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component, the "TwitterShareButton" doesn't inject a reference of the support JavaScript file.

<TwitterShareButton Text="..."
  DisableClientScriptAutoInjection="false">
</TwitterShareButton>

b. Configure global options for "TwitterShareButton" at "Startup" class

You can also disable automatic injection of a reference of the support JavaScript file by configure global options for "TwitterShareButton" at "Startup" class, like this.

...
using Toolbelt.Blazor.Extensions.DependencyInjection; // <- Add this...

public class Startup
{
  public void ConfigureServices(IServiceCollection services)
  {
    // ...and add flollow lines.
    services.AddTwitterShareButtonGlobalOptions(options =>
    {
       options.DisableClientScriptAutoInjection = false;
    });
   ...

Note

(a)

Disabling "automatic injection" by configure global options way is more high priority than the "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component.

If you configure global options "DisableClientScriptAutoInjection" to be true, then "automatic injection" never work even if set the "DisableClientScriptAutoInjection" property of the "TwitterShareButton" component to false explicity.

(b)

If you disable "automatic injection", Adding a reference to the support JavaScript file is a responsibility of you.

For example, you can do it by editing "index.html" and add &lt;script&gt; tag statically like following:

<!DOCTYPE html>
<html>
<head>
  ...
  <script src="_content/Toolbelt.Blazor.TwitterShareButton/script.js"></script>

Release Note

  • v.7.0.0
    • Support Server-side Blazor Server app.
    • Made automatic injection of a reference of the support file is configurable.
  • v.6.0.0 - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 9 (not compatible with v.3.0.0 Preview 8 or before.)
  • v.5.0.0 - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 8 (not compatible with v.3.0.0 Preview 4 or before.)
  • v.4.0.0 - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 4 (not compatible with v.0.9.0 or before.)
  • v.3.0.0 - BREAKING CHANGE: Support Blazor v.0.9.0 (not compatible with v.0.8.0 or before.)
  • v.2.0.0 - BREAKING CHANGE: Support Blazor v.0.8.0 (not compatible with v.0.7.0 or before.)
  • v.1.0.1 - Suppressed the flicker that occurs when parameters are updated.
  • v.1.0.0 - 1st release.

License

Mozilla Public License Version 2.0

Release Notes

v.7.0.0
- Support Server-side Blazor Server app.
- Made automatic injection of a reference of the support file is configurable.
v.6.0.0
- BREAKING CHANGE: Support Blazor v.3.0.0 Preview 9 (not compatible with Blazor v.3.0.0 Preview 8 or before.)
v.5.0.0
- BREAKING CHANGE: Support Blazor v.3.0.0 Preview 8 (not compatible with Blazor v.3.0.0 Preview 7 or before.)
v.4.0.0
- BREAKING CHANGE: Support Blazor v.3.0.0 Preview 4 (not compatible with v.0.9.0 or before.)
v.3.0.0
- BREAKING CHANGE: Support Blazor v.0.9.0 (not compatible with v.0.8.0 or before.)
v.2.0.0
- BREAKING CHANGE: Support Blazor v.0.8.0 (not compatible with v.0.7.0 or before.)
v.1.0.1
- Suppressed the flicker that occurs when parameters are updated.
v.1.0.0
- 1st release.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
7.0.0.31 49 9/29/2019
6.0.0.2 33 9/5/2019
5.0.0 42 8/19/2019
4.0.0.1 105 4/27/2019
3.0.0 106 3/9/2019
2.0.0 106 2/8/2019
1.0.1 122 12/18/2018
1.0.0 112 12/11/2018