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 FlyoutPage work + Docs improvements #38

Merged
merged 7 commits into from
Oct 16, 2023
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Burkus.Mvvm.Maui](art/BurkusMvvmMauiLogo.png)
![Burkus.Mvvm.Maui](https://raw.githubusercontent.com/BurkusCat/Burkus.Mvvm.Maui/main/art/BurkusMvvmMauiLogo.png)
#### Navigation - Parameter Passing - Lifecycle Events - Native Dialogs - Testability

### Stable: [![NuGet Stable](https://img.shields.io/nuget/v/Burkus.Mvvm.Maui.svg?label=NuGet)](https://www.nuget.org/packages/Burkus.Mvvm.Maui/) Latest Preview: [![NuGet Preview](https://img.shields.io/nuget/vpre/Burkus.Mvvm.Maui.svg?label=NuGet)](https://www.nuget.org/packages/Burkus.Mvvm.Maui/)
### Stable: [![NuGet Stable](https://img.shields.io/nuget/v/Burkus.Mvvm.Maui.svg?label=NuGet)](https://www.nuget.org/packages/Burkus.Mvvm.Maui/) [![Nuget](https://img.shields.io/nuget/dt/Burkus.Mvvm.Maui)](https://www.nuget.org/packages/Burkus.Mvvm.Maui) Latest Preview: [![NuGet Preview](https://img.shields.io/nuget/vpre/Burkus.Mvvm.Maui.svg?label=NuGet)](https://www.nuget.org/packages/Burkus.Mvvm.Maui/)

# Burkus.Mvvm.Maui (experimental)
`Burkus.Mvvm.Maui` is an MVVM (Model–view–viewmodel) framework designed for .NET MAUI. The library is developed with these key principles:
Expand All @@ -22,7 +22,7 @@
**⚠️ Warning**: `Burkus.Mvvm.Maui` is currently an experimental library. Expect frequent breaking API changes. This library will be versioned as ["0.y.z"](https://semver.org/#spec-item-4) until we establish a stable, well-liked API. Only then will we release versions "1.y.z" and beyond.

# Supporting the Project 💖
<a href="https://github.com/sponsors/BurkusCat"><img align="right" src="art/mona.png" alt="Mona the GitHub Sponsor Octocat smiling and holding a heart"></a>
<a href="https://github.com/sponsors/BurkusCat"><img align="right" src="https://raw.githubusercontent.com/BurkusCat/Burkus.Mvvm.Maui/main/art/mona.png" alt="Mona the GitHub Sponsor Octocat smiling and holding a heart"></a>

Hi there 👋 I'm Ronan Burke aka Burkus. I maintain this project during my spare time and I would love to be able to dedicate more time each month to supporting it! If you've found value in Burkus.Mvvm.Maui, I would greatly appreciate if you would be able to **[sponsor me on GitHub Sponsors](https://github.com/sponsors/BurkusCat)**. There are different rewards for each of the monthly or one-time sponsorship tiers such as:

Expand All @@ -46,7 +46,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="art/winui-login.png" width="612" alt="The Login page of the demo app running on WinUI"> | <img src="art/android-home.png" width="200" alt="The Home page of the demo app running on Android"> | <img src="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/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"> |
| -------- | ------- | ------- |

## Getting started
Expand Down Expand Up @@ -416,4 +416,4 @@ Contributions are very welcome! Please see the [contributing guide](CONTRIBUTING
# License 🪪
The project is distributed under the [MIT license](LICENSE). Contributors do not need to sign a CLA.

![Green letters: M V V M laid out vertically](art/MvvmVertical.png)
![Green letters: M V V M laid out vertically](https://raw.githubusercontent.com/BurkusCat/Burkus.Mvvm.Maui/main/art/MvvmVertical.png)
34 changes: 34 additions & 0 deletions samples/DemoApp/DemoApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Images\contacts.png" />
<None Remove="Resources\Images\reminders.png" />
<None Remove="Resources\Images\tabs.png" />
<None Remove="Resources\Images\todo.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
Expand All @@ -67,6 +74,18 @@
<Compile Update="Views\ChangeUsernamePage.xaml.cs">
<DependentUpon>ChangeUsernamePage.xaml</DependentUpon>
</Compile>
<Compile Update="Views\Flyouts\TodoPage.xaml.cs">
<DependentUpon>TodoPage.xaml</DependentUpon>
</Compile>
<Compile Update="Views\Flyouts\RemindersPage.xaml.cs">
<DependentUpon>RemindersPage.xaml</DependentUpon>
</Compile>
<Compile Update="Views\Flyouts\ContactsPage.xaml.cs">
<DependentUpon>ContactsPage.xaml</DependentUpon>
</Compile>
<Compile Update="Views\Flyouts\DemoFlyoutPage.xaml.cs">
<DependentUpon>DemoFlyoutPage.xaml</DependentUpon>
</Compile>
<Compile Update="Views\UriTestPage.xaml.cs">
<DependentUpon>UriTestPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -101,6 +120,21 @@
<MauiXaml Update="Views\ChangeUsernamePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\Flyouts\TodoPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\Flyouts\RemindersPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\Flyouts\ContactsPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\Flyouts\DemoFlyoutPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\Flyouts\FlyoutMenuPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\HomePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
Expand Down
24 changes: 22 additions & 2 deletions samples/DemoApp/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,18 @@ public static MauiApp CreateMauiApp()

public static MauiAppBuilder RegisterViewModels(this MauiAppBuilder mauiAppBuilder)
{
mauiAppBuilder.Services.AddTransient<ChangeUsernameViewModel>();
// flyouts
mauiAppBuilder.Services.AddTransient<ContactsViewModel>();
mauiAppBuilder.Services.AddTransient<DemoFlyoutViewModel>();
mauiAppBuilder.Services.AddTransient<FlyoutMenuViewModel>();
mauiAppBuilder.Services.AddTransient<RemindersViewModel>();
mauiAppBuilder.Services.AddTransient<TodoViewModel>();

// tabs
mauiAppBuilder.Services.AddTransient<DemoTabsViewModel>();

// pages
mauiAppBuilder.Services.AddTransient<ChangeUsernameViewModel>();
mauiAppBuilder.Services.AddTransient<HomeViewModel>();
mauiAppBuilder.Services.AddTransient<LoginViewModel>();
mauiAppBuilder.Services.AddTransient<RegisterViewModel>();
Expand All @@ -61,8 +71,18 @@ public static MauiAppBuilder RegisterViewModels(this MauiAppBuilder mauiAppBuild

public static MauiAppBuilder RegisterViews(this MauiAppBuilder mauiAppBuilder)
{
mauiAppBuilder.Services.AddTransient<ChangeUsernamePage>();
// flyouts
mauiAppBuilder.Services.AddTransient<ContactsPage>();
mauiAppBuilder.Services.AddTransient<DemoFlyoutPage>();
mauiAppBuilder.Services.AddTransient<FlyoutMenuPage>();
mauiAppBuilder.Services.AddTransient<RemindersPage>();
mauiAppBuilder.Services.AddTransient<TodoPage>();

// tabs
mauiAppBuilder.Services.AddTransient<DemoTabsPage>();

// pages
mauiAppBuilder.Services.AddTransient<ChangeUsernamePage>();
mauiAppBuilder.Services.AddTransient<HomePage>();
mauiAppBuilder.Services.AddTransient<LoginPage>();
mauiAppBuilder.Services.AddTransient<RegisterPage>();
Expand Down
10 changes: 10 additions & 0 deletions samples/DemoApp/Models/FlyoutPageItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace DemoApp.Models;

public class FlyoutPageItem
{
public string Title { get; set; }

public string IconSource { get; set; }

public Type TargetType { get; set; }
}
103 changes: 103 additions & 0 deletions samples/DemoApp/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions samples/DemoApp/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@
<value>Charlie</value>
<comment>Translate</comment>
</data>
<data name="Contacts_MyContacts" xml:space="preserve">
<value>My contacts:</value>
<comment>Translate</comment>
</data>
<data name="Contacts_Title" xml:space="preserve">
<value>Contacts</value>
<comment>Translate</comment>
</data>
<data name="DemoFlyout_Title" xml:space="preserve">
<value>Flyout</value>
<comment>Translate</comment>
</data>
<data name="DemoTabs_Title" xml:space="preserve">
<value>Tabbed Page</value>
<comment>Translate</comment>
Expand All @@ -193,6 +205,10 @@
<value>Change Username (no animation)</value>
<comment>Translate</comment>
</data>
<data name="Home_Button_FlyoutPageDemo" xml:space="preserve">
<value>Flyout Page demo</value>
<comment>Translate</comment>
</data>
<data name="Home_Button_LogoutWithUriSyntax" xml:space="preserve">
<value>Logout with URI syntax:</value>
<comment>Translate</comment>
Expand All @@ -205,6 +221,10 @@
<value>Tabbed Page demo</value>
<comment>Translate</comment>
</data>
<data name="Home_SubHeading_FlyoutNavigation" xml:space="preserve">
<value>Flyout navigation:</value>
<comment>Translate</comment>
</data>
<data name="Home_SubHeading_ModalNavigation" xml:space="preserve">
<value>Modal navigation:</value>
<comment>Translate</comment>
Expand Down Expand Up @@ -265,6 +285,34 @@
<value>Register</value>
<comment>Translate</comment>
</data>
<data name="Reminders_Button_SwitchFlyoutToContacts" xml:space="preserve">
<value>Switch Flyout to Contacts</value>
<comment>Translate</comment>
</data>
<data name="Reminders_ReminderList" xml:space="preserve">
<value>1. Remember to eat breakfast.
2. Remember to smile :)
3. Remember to git rebase</value>
<comment>Translate</comment>
</data>
<data name="Reminders_Title" xml:space="preserve">
<value>Reminders</value>
<comment>Translate</comment>
</data>
<data name="Todo_Button_PushNewPageIntoDetail" xml:space="preserve">
<value>Push new page into detail</value>
<comment>Translate</comment>
</data>
<data name="Todo_Title" xml:space="preserve">
<value>Todo</value>
<comment>Translate</comment>
</data>
<data name="Todo_TodoList" xml:space="preserve">
<value>☑ Phase 1: Collect underpants
☐ Phase 2: ?????
☐ Phase 3: Profit</value>
<comment>Translate</comment>
</data>
<data name="UriTest_Button_GoBackThreeTimes" xml:space="preserve">
<value>Go Back Three Times</value>
<comment>Translate</comment>
Expand Down
Binary file added samples/DemoApp/Resources/Images/contacts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading