Skip to content

Commit

Permalink
Merge pull request #56 from BurkusCat/misc-changes
Browse files Browse the repository at this point in the history
Misc maintenance improvements
  • Loading branch information
BurkusCat authored Jan 1, 2024
2 parents 838e3ac + 0805e2b commit 5e31f7c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
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

0 comments on commit 5e31f7c

Please sign in to comment.