![]() |
VOOZH | about |
dotnet add package SharedNetCoreLibrary --version 1.2.9
NuGet\Install-Package SharedNetCoreLibrary -Version 1.2.9
<PackageReference Include="SharedNetCoreLibrary" Version="1.2.9" />
<PackageVersion Include="SharedNetCoreLibrary" Version="1.2.9" />Directory.Packages.props
<PackageReference Include="SharedNetCoreLibrary" />Project file
paket add SharedNetCoreLibrary --version 1.2.9
#r "nuget: SharedNetCoreLibrary, 1.2.9"
#:package SharedNetCoreLibrary@1.2.9
#addin nuget:?package=SharedNetCoreLibrary&version=1.2.9Install as a Cake Addin
#tool nuget:?package=SharedNetCoreLibrary&version=1.2.9Install as a Cake Tool
A shared library containing recurring features & utilities for .NET MAUI applications
If you want to support me, you can order over following affilate links (I'll get a small share from your purchase from the corresponding store).
(*) Affiliate link Thank you very much for supporting me!
Get the latest version from nuget.org<br>
👁 NuGet
👁 NuGet
👁 NuGet
Add the MauiProgram.cs add following line.
MauiAppBuilder builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.ConfigureSyncfusionCore()
.ConfigureCoreLibrary() // <= add this
//...
This will automatically initialize following extensions.
.UseMauiCommunityToolkit()
.ConfigureDispatching()
.ConfigureDispatchManager() // Inits the DispatchManager with the configured dispatcher
Please find a list of available content below.
The UserSecretsManager helps you to manage your user secrets in your application. It reads the secrets.json file stored in the user profile folder.
if (Assembly is null)
{
Assembly = IntrospectionExtensions.GetTypeInfo(typeof(MauiProgram)).Assembly;
UserSecretsManager.Settings = new UserSecretsManager.UserSecretsManagerBuilder()
.WithAppNamespace("SharedMauiXamlStylesLibrary.SampleApp")
.WithCustomAssambly(Assembly)
.Build();
}
xmlns:behaviors="clr-namespace:AndreasReitberger.Shared.Core.Behaviors;assembly=SharedMauiCoreLibrary"
This Behavior executes a Command when the specified Event is fired.
<sliders:SfSlider
Margin="0,4"
Minimum="0" Maximum="{Binding LimitFan}"
StepSize="1"
MinorTicksPerInterval="100"
ShowLabels="True"
>
<sliders:SfSlider.Behaviors>
<behaviors:EventToCommandBehavior
EventName="ValueChangeEnd"
Command="{Binding SetFanCommand}"
/>
</sliders:SfSlider.Behaviors>
</sliders:SfSlider>
xmlns:converters="clr-namespace:AndreasReitberger.Shared.Core.Converters;assembly=SharedMauiCoreLibrary"
This Converter converts a Boolean into a reverse and non-reverse visibility (if value is true, it returns false)
<Label
Style="{StaticResource SmallLabelStyle}"
TextColor="{DynamicResource Error}"
Text="{x:Static localization:Strings.NotAvailableDots}"
IsVisible="{Binding HasDoubleExtruder, Converter={StaticResource BooleanReverseVisibilityConverter}}"
/>
This Converter converts a byte[] into an Image
<Image
VerticalOptions="Start"
Margin="{OnIdiom Phone='-4,0', Tablet='-62,0', Default='-4,0'}"
Source="{Binding Thumbnail, Converter={StaticResource ByteArrayToImageConverter}}"
>
<Image.Style>
<Style TargetType="Image">
<Setter Property="Aspect" Value="AspectFit"/>
<Style.Triggers>
<DataTrigger
TargetType="Image"
Binding="{Binding IsPortrait}"
Value="False">
<Setter Property="Aspect" Value="AspectFill"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
This Converter converts a Color into Colors.White or Colors.Black. This helps to get the
accurate oreground for a colored Background.
<Border
Background="{Binding HexCode, Converter={StaticResource StringToColorConverter}, Mode=OneWay}"
>
<Label
Text="{Binding HexCode}"
TextColor="{Binding Source={RelativeSource AncestorType={x:Type Border}}, Path=Background, Converter={StaticResource BrushToBlackWhiteConverter}, Mode=OneWay}"
Style="{StaticResource LabelStyle}"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"
/>
</Border>
This Converter converts a Double into a TimeSpan.
<Label
LineBreakMode="WordWrap" Margin="2,10,0,10"
VerticalTextAlignment="Center"
FontSize="{OnIdiom Tablet=14, Default=12}"
>
<Label.Style>
<Style TargetType="Label" BasedOn="{StaticResource TitleViewHeadlineLabelStyle}">
<Setter Property="IsVisible" Value="False"/>
<Style.Triggers>
<MultiTrigger
TargetType="Label">
<MultiTrigger.Conditions>
<BindingCondition Binding="{Binding IsPrinting, Mode=TwoWay}" Value="True"/>
<BindingCondition Binding="{Binding ShowRemainingPrintTimeInTitleView}" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="IsVisible" Value="True"/>
</MultiTrigger>
</Style.Triggers>
</Style>
</Label.Style>
<Label.FormattedText>
<FormattedString>
<Span Text="("/>
<Span Text="{Binding RemainingPrintTime, Converter={StaticResource DoubleHoursToTimeSpanConverter}}"/>
<Span Text=")"/>
</FormattedString>
</Label.FormattedText>
</Label>
This Converter converts a List<string> into a single String with the defined separator char.
This Converter converts a long into a Double. The result wil be in GigaBytes.
This Converter converts a long into a Double. The result wil be in MegaBytes.
This Converter converts a String (hex formated string) into a Color.
This Converter converts a Double (UNIX based) into a DateTime.
<Label
LineBreakMode="WordWrap" Margin="2,10,0,10"
VerticalTextAlignment="Center"
FontSize="{OnIdiom Tablet=14, Default=12}"
>
<Label.FormattedText>
<FormattedString>
<Span Text="("/>
<Span Text="{Binding CurrentDateTime, Converter={StaticResource UnixDateToDateTimeConverter}}"/>
<Span Text=")"/>
</FormattedString>
</Label.FormattedText>
</Label>
This Converter converts a Double (UNIX based) into a TimeSpan.
<Label
LineBreakMode="WordWrap" Margin="2,10,0,10"
VerticalTextAlignment="Center"
FontSize="{OnIdiom Tablet=14, Default=12}"
>
<Label.FormattedText>
<FormattedString>
<Span Text="("/>
<Span Text="{Binding RemainingPrintTime, Converter={StaticResource UnixDoubleHoursToTimeSpanConverter}}"/>
<Span Text=")"/>
</FormattedString>
</Label.FormattedText>
</Label>
This Converter converts a Uri into a String.
namespace AndreasReitberger.Shared.Core
This Class contains all needed properties for a ViewModel. You can inherit from this Class directly for your ViewModel,
or create an own ViewModelBase and inherit there form this class.
public partial class BaseViewModel : ViewModelBase
{
#region Properties
#region App
bool _isBeta = SettingsStaticDefault.App_IsBeta;
public new bool IsBeta
{
get { return _isBeta; }
set { SetProperty(ref _isBeta, value); }
}
bool _isLightVersion = SettingsStaticDefault.App_IsLightVersion;
public bool IsLightVersion
{
get { return _isLightVersion; }
set { SetProperty(ref _isLightVersion, value); }
}
bool _isTabletMode = false;
public bool IsTabletMode
{
get { return _isTabletMode; }
set { SetProperty(ref _isTabletMode, value); }
}
#endregion
#region Navigation
bool _isViewShown = false;
public bool IsViewShown
{
get { return _isViewShown; }
set { SetProperty(ref _isViewShown, value); }
}
#endregion
#region Connection
bool _isConnecting = false;
public bool IsConnecting
{
get { return _isConnecting; }
set { SetProperty(ref _isConnecting, value); }
}
#endregion
#endregion
#region Constructor
public BaseViewModel()
{
}
#endregion
#region LiveCycle
public void OnDisappearing()
{
try
{
if (SettingsApp.SettingsChanged)
{
// Notify other modules
MessagingCenter.Send(new AppMessageInfo(), AppMessages.OnSettingsChanged.ToString());
SettingsApp.SaveSettings();
SettingsApp.SettingsChanged = false;
}
}
catch (Exception exc)
{
// Log error
EventManager.Instance.LogError(exc);
}
}
#endregion
}
This Class uses Newtonsoft.JSON in order to serialize and deserialize objects to strings and vice reverse.
This is helpful if you want to store Collections or custom objects in the MAUI.Preferences (Settings).
// Convert to a String
SettingsApp.WebCam_DefaultWebCamSettings = JsonConvertHelper.ToSettingsString(value);
// Convert back to an object
ObservableCollection<KlipperWebCamSettingsInfo> webcams = JsonConvertHelper.ToObject(SettingsApp.WebCam_Settings, new ObservableCollection<KlipperWebCamSettingsInfo>());
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on SharedNetCoreLibrary:
| Package | Downloads |
|---|---|
|
SharedMauiCoreLibrary
A core libray used for our .NET MAUI libraries. |
|
|
SharedMauiCoreLibrary.Licensing
A libray used for .NET MAUI projects to manage licenses. |
|
|
SettingsMaui
A .NET MAUI library to store settings locally and in the cloud |
|
|
RestApiClientSharp
A simple library to make REST-API calls to public API's. |
|
|
SharedNetCoreLibrary.Firebase
A core libray used for our .NET libraries. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.9 | 230 | 6/12/2026 |
| 1.2.8 | 475 | 5/20/2026 |
| 1.2.7 | 1,021 | 4/28/2026 |
| 1.2.6 | 275 | 4/14/2026 |
| 1.2.5 | 1,656 | 2/16/2026 |
| 1.2.4 | 712 | 1/16/2026 |
| 1.2.3 | 683 | 12/17/2025 |
| 1.2.2.1 | 836 | 12/3/2025 |
| 1.2.1 | 724 | 12/1/2025 |
| 1.2.0 | 292 | 11/27/2025 |
| 1.2.0-preview1 | 486 | 11/21/2025 |
| 1.1.20 | 590 | 11/12/2025 |
| 1.1.19 | 634 | 10/27/2025 |
| 1.1.18 | 1,343 | 9/16/2025 |
| 1.1.17 | 1,442 | 7/7/2025 |
| 1.1.16 | 379 | 6/12/2025 |
| 1.1.15 | 347 | 4/22/2025 |
| 1.1.14 | 428 | 3/16/2025 |
| 1.1.14-preview2 | 378 | 2/18/2025 |
| 1.1.14-preview1 | 224 | 12/19/2024 |
Check GitHub releases for changelog.