Skip to content

Commit

Permalink
Support for EasyMicroservices.UI.BlazorComponents
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-YousefiTelori committed Dec 27, 2023
1 parent 838b01d commit f4b23fc
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,42 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.UI.Blazor
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "App", "App", "{13E6A614-2843-4B9B-A175-7C6D66E141E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyMicroservices.UI.Cores.Mvvm", "..\Cores\EasyMicroservices.UI.Cores.Mvvm\EasyMicroservices.UI.Cores.Mvvm.csproj", "{CCEEDCC5-B976-4B0B-A293-7D91B893612D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Debug|x64.ActiveCfg = Debug|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Debug|x64.Build.0 = Debug|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Debug|x86.ActiveCfg = Debug|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Debug|x86.Build.0 = Debug|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Release|Any CPU.Build.0 = Release|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Release|x64.ActiveCfg = Release|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Release|x64.Build.0 = Release|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Release|x86.ActiveCfg = Release|Any CPU
{86DEB4A1-E776-461D-9C09-B0484799E6FA}.Release|x86.Build.0 = Release|Any CPU
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Debug|x64.ActiveCfg = Debug|x64
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Debug|x64.Build.0 = Debug|x64
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Debug|x86.ActiveCfg = Debug|x86
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Debug|x86.Build.0 = Debug|x86
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Release|Any CPU.Build.0 = Release|Any CPU
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Release|x64.ActiveCfg = Release|x64
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Release|x64.Build.0 = Release|x64
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Release|x86.ActiveCfg = Release|x86
{CCEEDCC5-B976-4B0B-A293-7D91B893612D}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
@using EasyMicroservices.UI.Cores
@using MudBlazor
@inject BaseViewModel viewModel;
@* Class="@DialogClass" *@
<MudRTLProvider RightToLeft="BaseViewModel.IsRightToLeft">
<MudDialog @ref="dialog" @bind-IsVisible="IsShowDialog">
<TitleContent>
@TitleContent
</TitleContent>
<DialogContent>
@DialogContent
</DialogContent>
<DialogActions>
@DialogActions
</DialogActions>
</MudDialog>
</MudRTLProvider>

<style>
.dialog-background-class {
backdrop-filter: blur(10px);
}
</style>

@code {
public BaseViewModel ViewModel
{
get
{
return viewModel;
}
}
bool IsShowDialog;
MudDialog dialog;

[Parameter]
[Category("Behavior")]
public RenderFragment TitleContent { get; set; }

[Parameter]
[Category("Behavior")]
public RenderFragment DialogContent { get; set; }

[Parameter]
[Category("Behavior")]
public RenderFragment DialogActions { get; set; }

DialogOptions DialogOptions = new DialogOptions()
{
ClassBackground = "dialog-background-class",
CloseOnEscapeKey = true,
MaxWidth = MaxWidth.ExtraSmall
};

Func<Task> _onAfterLoadAsync;
bool IsNeedToShow = false;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
if (IsNeedToShow)
{
_ = Task.Run(async () =>
{
await Task.Delay(500);
await _onAfterLoadAsync?.Invoke();
});
IsNeedToShow = false;
}
}

protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
}

public void ShowDialog(Action onAfterLoad = default)
{
if (onAfterLoad != null)
{
_onAfterLoadAsync = () =>
{
onAfterLoad();
return Task.CompletedTask;
};
}
IsNeedToShow = true;
IsShowDialog = true;
}

public void ShowDialog(Func<Task> onAfterLoad)
{
_onAfterLoadAsync = onAfterLoad;
IsNeedToShow = true;
IsShowDialog = true;
}

public void CloseDialog()
{
IsShowDialog = false;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.1</Version>
<Description>Core UI compoents.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>component,microcomponent,ui,core</PackageTags>
<PackageProjectUrl>https://github.com/EasyMicroservices/UICores</PackageProjectUrl>
<LangVersion>latest</LangVersion>
<DocumentationFile>.\bin\$(Configuration)\$(TargetFramework)\EasyMicroservices.UI.BlazorComponents.xml</DocumentationFile>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.13" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.11.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.14" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.14" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.25" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.25" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Cores\EasyMicroservices.UI.Cores.Mvvm\EasyMicroservices.UI.Cores.Mvvm.csproj" />
</ItemGroup>

</Project>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f4b23fc

Please sign in to comment.