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

Misc maintenance improvements #56

Merged
merged 5 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ See the `DemoApp` in the `/samples` folder of this repository for a full example

🧪 [Check out the Test Project](/tests/DemoApp.UnitTests/) for demonstrations how you can write tests for code that calls this library. This will help ensure you write rock-solid apps!

| <img src="https://raw.githubusercontent.com/BurkusCat/Burkus.Mvvm.Maui/main/art/winui-login.png" width="612" alt="The Login page of the demo app running on WinUI"> | <img src="https://raw.githubusercontent.com/BurkusCat/Burkus.Mvvm.Maui/main/art/android-home.png" width="200" alt="The Home page of the demo app running on Android"> | <img src="https://raw.githubusercontent.com/BurkusCat/Burkus.Mvvm.Maui/main/art/android-tabs.png" width="200" alt="The Tabs page of the demo app running on Android"> |
| <img src="https://raw.githubusercontent.com/BurkusCat/Burkus.Mvvm.Maui/main/art/winui-login.png" width="612" alt="The Login page of the demo app running on WinUI"> | <img src="https://raw.githubusercontent.com/BurkusCat/Burkus.Mvvm.Maui/main/art/ios-home.png" width="200" alt="The Home page of the demo app running on iOS"> | <img src="https://raw.githubusercontent.com/BurkusCat/Burkus.Mvvm.Maui/main/art/android-tabs.png" width="200" alt="The Tabs page of the demo app running on Android"> |
| -------- | ------- | ------- |

## Getting started
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ The latest version of the package only will be supported with security fixes. If

| Version | Supported |
| ------- | ------------------ |
| 0.1.x | :white_check_mark: |
| < 0.1 | :x: |
| 0.2.x | :white_check_mark: |
| < 0.2 | :x: |

## Reporting a Vulnerability
Contact options:
Expand Down
Binary file removed art/android-home.png
Binary file not shown.
Binary file added art/ios-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions samples/DemoApp/ViewModels/BaseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ public BaseViewModel(

#region Lifecycle events

public virtual async Task OnNavigatedTo(NavigationParameters parameters)
public virtual Task OnNavigatedTo(NavigationParameters parameters)
{
return Task.CompletedTask;
}

public virtual async Task OnNavigatedFrom(NavigationParameters parameters)
public virtual Task OnNavigatedFrom(NavigationParameters parameters)
{
return Task.CompletedTask;
}

public virtual async Task OnNavigatingFrom(NavigationParameters parameters)
public virtual Task OnNavigatingFrom(NavigationParameters parameters)
{
return Task.CompletedTask;
}

#endregion Lifecycle events
Expand Down
13 changes: 11 additions & 2 deletions src/Burkus.Mvvm.Maui.SourceGenerators/AppSourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void Execute(GeneratorExecutionContext context)
// check if the App class is partial and inherits from Application
var appSymbol = semanticModel.GetDeclaredSymbol(appClass);

if (appSymbol is not null && isPartial && appSymbol.BaseType.Equals(semanticModel.Compilation.GetTypeByMetadataName("Microsoft.Maui.Controls.Application")))
if (appSymbol is not null && isPartial && SymbolEqualityComparer.Default.Equals(appSymbol.BaseType, semanticModel.Compilation.GetTypeByMetadataName("Microsoft.Maui.Controls.Application")))
{
chosenAppSymbol = appSymbol;
break;
Expand Down Expand Up @@ -82,7 +82,16 @@ protected override Window CreateWindow(IActivationState? activationState)
burkusMvvmBuilder.onStartFunc.Invoke(navigationService, serviceProvider);
}}

return base.CreateWindow(activationState);
var window = base.CreateWindow(activationState);

#if WINDOWS
if (window != null)
{{
window.Title = AppInfo.Current.Name;
}}
#endif

return window;
}}
}}";

Expand Down
Loading