Skip to content

Commit f8aa748

Browse files
authored
chore(hybrid-apps):unify the service registration as in our getting started resources (#182)
1 parent eb3aec2 commit f8aa748

File tree

6 files changed

+23
-3
lines changed

6 files changed

+23
-3
lines changed

common/hybrid-blazor-apps/BlazorMauiApp/MauiProgram.cs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public static MauiApp CreateMauiApp()
1616
});
1717

1818
builder.Services.AddMauiBlazorWebView();
19+
20+
builder.Services.AddTelerikBlazor();
1921
#if DEBUG
2022
builder.Services.AddBlazorWebViewDeveloperTools();
2123
#endif

common/hybrid-blazor-apps/BlazorMauiApp/_Imports.razor

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
@using Telerik.Blazor
1313
@using Telerik.Blazor.Components
14-
@using Telerik.Blazor.Services
1514

1615
@using Telerik.DataSource
1716
@using Telerik.DataSource.Extensions

common/hybrid-blazor-apps/BlazorWinFormsApp/Program.cs

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
using Microsoft.Extensions.DependencyInjection;
45
using System;
56
using System.Collections.Generic;
67
using System.Linq;
@@ -25,7 +26,17 @@ static void Main()
2526
Application.SetHighDpiMode(HighDpiMode.SystemAware);
2627
Application.EnableVisualStyles();
2728
Application.SetCompatibleTextRenderingDefault(false);
29+
30+
var services = new ServiceCollection();
31+
32+
ConfigureServices(services);
33+
2834
Application.Run(new Form1());
2935
}
36+
37+
private static void ConfigureServices(ServiceCollection services)
38+
{
39+
services.AddTelerikBlazor();
40+
}
3041
}
3142
}

common/hybrid-blazor-apps/BlazorWinFormsApp/_Imports.razor

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
@using Telerik.Blazor
1010
@using Telerik.Blazor.Components
11-
@using Telerik.Blazor.Services
1211

1312
@using Telerik.DataSource
1413
@using Telerik.DataSource.Extensions

common/hybrid-blazor-apps/BlazorWpfApp/App.xaml.cs

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
using Microsoft.Extensions.DependencyInjection;
45
using System;
56
using System.Windows;
67

@@ -17,6 +18,15 @@ private void Application_Startup(object sender, StartupEventArgs e)
1718
{
1819
MessageBox.Show(error.ExceptionObject.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
1920
};
21+
22+
var services = new ServiceCollection();
23+
24+
ConfigureServices(services);
25+
}
26+
27+
private static void ConfigureServices(ServiceCollection services)
28+
{
29+
services.AddTelerikBlazor();
2030
}
2131
}
2232
}

common/hybrid-blazor-apps/BlazorWpfApp/_Imports.razor

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
@using Telerik.Blazor
1414
@using Telerik.Blazor.Components
15-
@using Telerik.Blazor.Services
1615

1716
@using Telerik.DataSource
1817
@using Telerik.DataSource.Extensions

0 commit comments

Comments
 (0)