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

chore: move Views to Eppie.App.Shared #381

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 source/Eppie.App/Eppie.App.Shared/App.UWP.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(Shared.Views.MainPage), e.Arguments);
rootFrame.Navigate(typeof(Tuvi.App.Shared.Views.MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
Expand Down
2 changes: 1 addition & 1 deletion source/Eppie.App/Eppie.App.Shared/App.Uno.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(Shared.Views.MainPage), args.Arguments);
rootFrame.Navigate(typeof(Tuvi.App.Shared.Views.MainPage), args.Arguments);
}
// Ensure the current window is active
MainWindow.Activate();
Expand Down
5 changes: 5 additions & 0 deletions source/Eppie.App/Eppie.App.Shared/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Tuvi.App.ViewModels.Services;
using Tuvi.Core;
using Tuvi.OAuth2;

#if WINDOWS_UWP
using Windows.UI.Xaml;
Expand All @@ -14,5 +16,8 @@ namespace Eppie.App.Shared
public partial class App : Application
{
public INavigationService NavigationService { get; private set; }
public ITuviMail Core { get; private set; }
public ILocalSettingsService LocalSettingsService { get; private set; }
public AuthorizationProvider AuthProvider { get; private set; }
}
}
127 changes: 127 additions & 0 deletions source/Eppie.App/Eppie.App.Shared/Eppie.App.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Services\NavigationService.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Services\NotificationService.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\ElementHierarchyTools.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Views\BasePage.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)App.Uno.xaml.cs">
Expand Down Expand Up @@ -96,9 +97,63 @@
<Compile Include="$(MSBuildThisFileDirectory)Controls\ProtonAccountSettingsControl.xaml.cs">
<DependentUpon>ProtonAccountSettingsControl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\AboutPage.xaml.cs">
<DependentUpon>AboutPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\AccountSettingsPage.xaml.cs">
<DependentUpon>AccountSettingsPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\AllMessagesPage.xaml.cs">
<DependentUpon>AllMessagesPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\ContactMessagesPage.xaml.cs">
<DependentUpon>ContactMessagesPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\DecentralizedAccountSettingsPage.xaml.cs">
<DependentUpon>DecentralizedAccountSettingsPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\FolderMessagesPage.xaml.cs">
<DependentUpon>FolderMessagesPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\IdentityManagerPage.xaml.cs">
<DependentUpon>IdentityManagerPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\MessagePage.xaml.cs">
<DependentUpon>MessagePage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\NewMessagePage.xaml.cs">
<DependentUpon>NewMessagePage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\PasswordPage.xaml.cs">
<DependentUpon>PasswordPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\PgpKeyPage.xaml.cs">
<DependentUpon>PgpKeyPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\PgpKeysPage.xaml.cs">
<DependentUpon>PgpKeysPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\ProtonAccountSettingsPage.xaml.cs">
<DependentUpon>ProtonAccountSettingsPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\SeedGeneratePage.xaml.cs">
<DependentUpon>SeedGeneratePage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\SeedRestorePage.xaml.cs">
<DependentUpon>SeedRestorePage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\SelectEmailProviderPage.xaml.cs">
<DependentUpon>SelectEmailProviderPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\SettingsPage.xaml.cs">
<DependentUpon>SettingsPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Views\WelcomePage.xaml.cs">
<DependentUpon>WelcomePage.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="$(MSBuildThisFileDirectory)App.xaml">
Expand Down Expand Up @@ -169,10 +224,82 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\AboutPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\AccountSettingsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\AllMessagesPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\ContactMessagesPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\DecentralizedAccountSettingsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\FolderMessagesPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\IdentityManagerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\MainPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\MessagePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\NewMessagePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\PasswordPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\PgpKeyPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\PgpKeysPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\ProtonAccountSettingsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\SeedGeneratePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\SeedRestorePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\SelectEmailProviderPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\SettingsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Views\WelcomePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<PRIResource Include="$(MSBuildThisFileDirectory)Resources\Strings\en\Resources.resw">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Tuvi.App.ViewModels;
using Tuvi.App.ViewModels;
using Windows.ApplicationModel;

namespace Tuvi.App.Shared.Views
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using Tuvi.App.ViewModels;
using Tuvi.App.ViewModels;

#if WINDOWS_UWP
using Windows.UI.Xaml;
#else
using Microsoft.UI.Xaml;
#endif

namespace Tuvi.App.Shared.Views
{
Expand All @@ -13,7 +18,7 @@ public AccountSettingsPage()
{
this.InitializeComponent();

ViewModel.SetAuthProvider((Application.Current as App)?.AuthProvider);
ViewModel.SetAuthProvider((Application.Current as Eppie.App.Shared.App)?.AuthProvider);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
using System.Linq;
using System.Linq;
using Tuvi.App.IncrementalLoading;
using Tuvi.App.ViewModels;

#if WINDOWS_UWP
using Windows.UI.Xaml.Navigation;
#else
using Microsoft.UI.Xaml.Navigation;
#endif

namespace Tuvi.App.Shared.Views
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
using System.ComponentModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Tuvi.App.Shared.Models;
using Tuvi.App.Shared.Services;
using Tuvi.App.ViewModels;
using Tuvi.Core.Entities;

#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Navigation;
using Windows.Devices.Input;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Input;
#endif

namespace Tuvi.App.Shared.Views
{
Expand Down Expand Up @@ -38,7 +48,7 @@ public BasePage()

private void DataContextChangedImpl()
{
var app = Application.Current as App;
var app = Application.Current as Eppie.App.Shared.App;

ViewModel = DataContext as TViewModel;
ViewModel.SetCore(() => app.Core);
Expand Down Expand Up @@ -123,7 +133,7 @@ protected void OnPropertyChanged([CallerMemberName] string propertyName = null)

protected void ListViewSwipeContainer_PointerEntered(object sender, PointerRoutedEventArgs e)
{
if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse || e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen)
if (e.Pointer.PointerDeviceType == PointerDeviceType.Mouse || e.Pointer.PointerDeviceType == PointerDeviceType.Pen)
{
VisualStateManager.GoToState(sender as Control, "HoverButtonsShown", true);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
using System.Linq;
using System.Linq;
using Tuvi.App.IncrementalLoading;
using Tuvi.App.ViewModels;

#if WINDOWS_UWP
using Windows.UI.Xaml.Navigation;
#else
using Microsoft.UI.Xaml.Navigation;
#endif

namespace Tuvi.App.Shared.Views
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Tuvi.App.ViewModels;
using Tuvi.App.ViewModels;

namespace Tuvi.App.Shared.Views
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
using System.Linq;
using System.Linq;
using Tuvi.App.IncrementalLoading;
using Tuvi.App.ViewModels;

#if WINDOWS_UWP
using Windows.UI.Xaml.Navigation;
#else
using Microsoft.UI.Xaml.Navigation;
#endif

namespace Tuvi.App.Shared.Views
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Windows.Input;
using System.Windows.Input;
using CommunityToolkit.Mvvm.Input;
using Tuvi.App.ViewModels;

Expand Down
Loading
Loading