Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of WinUI with samples and features working #853

Merged
merged 16 commits into from
Jan 11, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/features/Features.WinUI3/Features.WinUI3.csproj
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<RootNamespace>Features.WinUI3</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
@@ -70,4 +70,4 @@
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
<Import Project="..\Features.CrossPlatform.Shared\Features.CrossPlatform.Shared.projitems" Label="Shared" />
</Project>
</Project>

Unchanged files with check annotations Beta

ActivityStopped(this, new ActivityEventArgs(activity));
}
public void OnActivityPostCreated(Activity activity, Bundle? savedInstanceState)

Check warning on line 112 in src/Caliburn.Micro.Platform/Platforms/Maui/Android/ActivityLifecycleCallbackHandler.cs

GitHub Actions / Analyse

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 112 in src/Caliburn.Micro.Platform/Platforms/Maui/Android/ActivityLifecycleCallbackHandler.cs

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
}
}
public void OnActivityPreCreated(Activity activity, Bundle? savedInstanceState)

Check warning on line 147 in src/Caliburn.Micro.Platform/Platforms/Maui/Android/ActivityLifecycleCallbackHandler.cs

GitHub Actions / Analyse

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 147 in src/Caliburn.Micro.Platform/Platforms/Maui/Android/ActivityLifecycleCallbackHandler.cs

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
}
protected Frame RootFrame { get; private set; }
#if WinUI3
public Window Window { get; private set; }

Check warning on line 33 in src/Caliburn.Micro.Platform/Platforms/uap/CaliburnApplication.cs

GitHub Actions / build

Missing XML comment for publicly visible type or member 'CaliburnApplication.Window'
#endif
/// <summary>
}
#if WinUI3
protected virtual Window CreateWindow()

Check warning on line 221 in src/Caliburn.Micro.Platform/Platforms/uap/CaliburnApplication.cs

GitHub Actions / build

Missing XML comment for publicly visible type or member 'CaliburnApplication.CreateWindow()'
{
return new Window();
}
public void InitializeWindow()

Check warning on line 227 in src/Caliburn.Micro.Platform/Platforms/uap/CaliburnApplication.cs

GitHub Actions / build

Missing XML comment for publicly visible type or member 'CaliburnApplication.InitializeWindow()'
{
if(Window == null)
Window = CreateWindow();
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()

Check warning on line 28 in samples/features/Features.WinUI3/App.xaml.cs

GitHub Actions / build

Non-nullable field 'container' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 28 in samples/features/Features.WinUI3/App.xaml.cs

GitHub Actions / build

Non-nullable field 'container' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
this.InitializeComponent();
}
AddChildResolver<HeaderedContentControl>(e => new[] { e.Header as DependencyObject });
AddChildResolver<HeaderedItemsControl>(e => new[] { e.Header as DependencyObject });
#endif
#if WINDOWS_UWP || WinUI3

Check warning

Code scanning / CodeQL

Useless upcast Warning

There is no need to upcast from
UIElement
to
DependencyObject
- the conversion can be done implicitly.
There is no need to upcast from
UIElement
to
DependencyObject
- the conversion can be done implicitly.

Check warning

Code scanning / CodeQL

Useless upcast Warning

There is no need to upcast from
UIElement
to
DependencyObject
- the conversion can be done implicitly.
There is no need to upcast from
UIElement
to
DependencyObject
- the conversion can be done implicitly.
AddChildResolver<SemanticZoom>(e => new[] { e.ZoomedInView as DependencyObject, e.ZoomedOutView as DependencyObject });
AddChildResolver<ListViewBase>(e => new[] { e.Header as DependencyObject });
#endif
/// </summary>
public class XamlPlatformProvider : IPlatformProvider {
#if WINDOWS_UWP
private CoreDispatcher dispatcher;

Check notice

Code scanning / CodeQL

Missed 'readonly' opportunity Note

Field 'dispatcher' can be 'readonly'.
#elif WinUI3
private DispatcherQueue dispatcher;

Check notice

Code scanning / CodeQL

Missed 'readonly' opportunity Note

Field 'dispatcher' can be 'readonly'.
#else
private readonly Dispatcher dispatcher;
#endif
#elif AVALONIA
dispatcher.Post(action);
#elif WinUI3
var dummy = dispatcher.TryEnqueue(() => action());

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
dummy
is useless, since its value is never read.
#else
dispatcher.BeginInvoke(action);
#endif