Skip to content

Commit 2048bdf

Browse files
committed
Update to OpenSilver v3.2.0
1 parent 7bef2ac commit 2048bdf

14 files changed

Lines changed: 38 additions & 102 deletions

File tree

.github/workflows/github-actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: OpenSilver.ControlsKit Build
22
env:
3-
next-release-version: '2.0.1'
3+
next-release-version: '3.3.0'
44
opensilver-package-source: 'https://www.myget.org/F/opensilver/api/v3/index.json'
55
suffix: 'preview'
66
on:

src/FastControls.TestApp/FastControls.TestApp.Browser/FastControls.TestApp.Browser.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<NoXamlPreprocessor>True</NoXamlPreprocessor>
6-
<OpenSilverType>6</OpenSilverType>
6+
<OpenSilverType>7</OpenSilverType>
77
<PublishTrimmed>true</PublishTrimmed>
88
<!-- Uncomment to enable AOT compilation when publishing -->
99
<!--<RunAOTCompilation>true</RunAOTCompilation>-->
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
15-
<PackageReference Include="OpenSilver" Version="2.2.0" />
13+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.11" />
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.11" PrivateAssets="all" />
15+
<PackageReference Include="OpenSilver.WebAssembly" Version="3.2.0" />
1616
</ItemGroup>
1717

1818
<PropertyGroup>

src/FastControls.TestApp/FastControls.TestApp.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
using DotNetForHtml5;
2-
using FastControls.TestApp.Browser.Interop;
3-
using Microsoft.AspNetCore.Components;
1+
using Microsoft.AspNetCore.Components;
42
using Microsoft.AspNetCore.Components.Rendering;
5-
using Microsoft.JSInterop;
63
using System.Threading.Tasks;
7-
using System;
4+
using OpenSilver.WebAssembly;
85

96
namespace FastControls.TestApp.Browser.Pages
107
{
@@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder)
1815
protected async override Task OnInitializedAsync()
1916
{
2017
await base.OnInitializedAsync();
21-
22-
if (!await JSRuntime.InvokeAsync<bool>("getOSFilesLoadedPromise"))
23-
{
24-
throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details.");
25-
}
26-
27-
Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime));
28-
Program.RunApplication();
18+
await Runner.RunApplicationAsync<TestApp.App>();
2919
}
30-
31-
[Inject]
32-
private IJSRuntime JSRuntime { get; set; }
3320
}
3421
}
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2-
using Microsoft.Extensions.DependencyInjection;
3-
using System;
4-
using System.Net.Http;
52
using System.Threading.Tasks;
6-
using System.Windows;
73

84
namespace FastControls.TestApp.Browser
95
{
@@ -13,19 +9,8 @@ public static async Task Main(string[] args)
139
{
1410
var builder = WebAssemblyHostBuilder.CreateDefault(args);
1511
builder.RootComponents.Add<App>("#app");
16-
17-
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
18-
1912
var host = builder.Build();
2013
await host.RunAsync();
2114
}
22-
23-
public static void RunApplication()
24-
{
25-
Application.RunApplication(() =>
26-
{
27-
var app = new FastControls.TestApp.App();
28-
});
29-
}
3015
}
3116
}

src/FastControls.TestApp/FastControls.TestApp.Simulator/FastControls.TestApp.Simulator.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net472</TargetFramework>
5+
<TargetFramework>net8.0-windows</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="OpenSilver.Simulator" Version="2.2.0" />
9+
<PackageReference Include="OpenSilver.Simulator" Version="3.2.0" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

src/FastControls.TestApp/FastControls.TestApp/FastControls.TestApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="OpenSilver" Version="2.2.0" />
10+
<PackageReference Include="OpenSilver" Version="3.2.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/FastControls/FastCheckBox.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
*====================================================================================*/
1212

1313
using System;
14+
using System.ComponentModel;
1415
using System.Globalization;
1516
using System.Windows;
1617
using CSHTML5.Internal;
1718

1819
namespace OpenSilver.ControlsKit
1920
{
21+
[EditorBrowsable(EditorBrowsableState.Never)]
22+
[Obsolete("Deprecated. It will be removed in a future release.")]
2023
public class FastCheckBox : FrameworkElement
2124
{
2225
public static readonly DependencyProperty IsCheckedProperty =
@@ -45,7 +48,7 @@ public class FastCheckBox : FrameworkElement
4548
CallPropertyChangedWhenLoadedIntoVisualTree = WhenToCallPropertyChangedEnum.IfPropertyIsSet
4649
});
4750

48-
private object _checkboxHtmlElementRef;
51+
private INTERNAL_HtmlDomElementReference _checkboxHtmlElementRef;
4952

5053
private IDisposable _jsCallbackOnClick;
5154
private object _labelHtmlElementRef;
@@ -102,7 +105,7 @@ public override object CreateDomElement(object parentRef, out object domElementW
102105
// Trigger click notifications
103106
OnClick(new RoutedEventArgs
104107
{
105-
OriginalSource = this
108+
Source = this
106109
});
107110
}));
108111
// Subscribe to the javascript click event through a simple listener
@@ -111,7 +114,10 @@ public override object CreateDomElement(object parentRef, out object domElementW
111114

112115
INTERNAL_HtmlDomManager.CreateDomElementAppendItAndGetStyle(
113116
"input",
114-
_labelHtmlElementRef, this, out _checkboxHtmlElementRef);
117+
_labelHtmlElementRef, this, out object checkboxHtmlElementRef);
118+
119+
_checkboxHtmlElementRef = (INTERNAL_HtmlDomElementReference)checkboxHtmlElementRef;
120+
115121
INTERNAL_HtmlDomManager.SetDomElementAttribute(_checkboxHtmlElementRef, "type", "checkbox");
116122

117123
INTERNAL_HtmlDomManager.CreateDomElementAppendItAndGetStyle("span", _labelHtmlElementRef, this,
@@ -192,21 +198,21 @@ private static void OnIsCheckedChanged(DependencyObject d, DependencyPropertyCha
192198
{
193199
checkbox.OnChecked(new RoutedEventArgs
194200
{
195-
OriginalSource = checkbox
201+
Source = checkbox
196202
});
197203
}
198204
else if (newValue == false)
199205
{
200206
checkbox.OnUnchecked(new RoutedEventArgs
201207
{
202-
OriginalSource = checkbox
208+
Source = checkbox
203209
});
204210
}
205211
else
206212
{
207213
checkbox.OnIndeterminate(new RoutedEventArgs
208214
{
209-
OriginalSource = checkbox
215+
Source = checkbox
210216
});
211217
}
212218
}

src/FastControls/OpenSilver.ControlsKit.FastControls.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
<ItemGroup>
21-
<PackageReference Include="OpenSilver" Version="2.2.0" />
21+
<PackageReference Include="OpenSilver" Version="3.2.0" />
2222
</ItemGroup>
2323

2424
</Project>

src/OpenSilver.ControlsKit.Controls/OpenSilver.ControlsKit.Controls.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="OpenSilver" Version="2.2.0" />
20+
<PackageReference Include="OpenSilver" Version="3.2.0" />
2121
</ItemGroup>
2222

2323
</Project>

0 commit comments

Comments
 (0)