Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
init for the rewrite!
Browse files Browse the repository at this point in the history
  • Loading branch information
shef3r committed Apr 30, 2023
1 parent b9e5923 commit 818d632
Show file tree
Hide file tree
Showing 61 changed files with 547 additions and 0 deletions.
9 changes: 9 additions & 0 deletions App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application
x:Class="Translate.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Translate">
<Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</Application.Resources>
</Application>
122 changes: 122 additions & 0 deletions App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace Translate
{
/// <summary>
/// Zapewnia zachowanie specyficzne dla aplikacji, aby uzupełnić domyślną klasę aplikacji.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Inicjuje pojedynczy obiekt aplikacji. Jest to pierwszy wiersz napisanego kodu
/// wykonywanego i jest logicznym odpowiednikiem metod main() lub WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}

/// <summary>
/// Wywoływane, gdy aplikacja jest uruchamiana normalnie przez użytkownika końcowego. Inne punkty wejścia
/// będą używane, kiedy aplikacja zostanie uruchomiona w celu otworzenia określonego pliku.
/// </summary>
/// <param name="e">Szczegóły dotyczące żądania uruchomienia i procesu.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;

// Nie powtarzaj inicjowania aplikacji, gdy w oknie znajduje się już zawartość,
// upewnij się tylko, że okno jest aktywne
if (rootFrame == null)
{
// Utwórz ramkę, która będzie pełnić funkcję kontekstu nawigacji, i przejdź do pierwszej strony
rootFrame = new Frame();

rootFrame.NavigationFailed += OnNavigationFailed;

if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Załaduj stan z wstrzymanej wcześniej aplikacji
}

// Umieść ramkę w bieżącym oknie
Window.Current.Content = rootFrame;
}

if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// Kiedy stos nawigacji nie jest przywrócony, przejdź do pierwszej strony,
// konfigurując nową stronę przez przekazanie wymaganych informacji jako
// parametr
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}

//----< Transparent Title >----

//using Windows.UI.ViewManagement;

//window as default-size

Windows.UI.ViewManagement.ApplicationViewTitleBar uwpTitleBar = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar;

uwpTitleBar.ButtonBackgroundColor = Windows.UI.Colors.Transparent;

uwpTitleBar.BackgroundColor = Windows.UI.Colors.Transparent;



//using Windows.ApplicationModel.Core

Windows.ApplicationModel.Core.CoreApplicationViewTitleBar coreTitleBar = Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().TitleBar;

coreTitleBar.ExtendViewIntoTitleBar = true;

//----</ Transparent Title >----
// Upewnij się, ze bieżące okno jest aktywne
Window.Current.Activate();
}
}

/// <summary>
/// Wywoływane, gdy nawigacja do konkretnej strony nie powiedzie się
/// </summary>
/// <param name="sender">Ramka, do której nawigacja nie powiodła się</param>
/// <param name="e">Szczegóły dotyczące niepowodzenia nawigacji</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}

/// <summary>
/// Wywoływane, gdy wykonanie aplikacji jest wstrzymywane. Stan aplikacji jest zapisywany
/// bez wiedzy o tym, czy aplikacja zostanie zakończona, czy wznowiona z niezmienioną zawartością
/// pamięci.
/// </summary>
/// <param name="sender">Źródło żądania wstrzymania.</param>
/// <param name="e">Szczegóły żądania wstrzymania.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Zapisz stan aplikacji i zatrzymaj wszelkie aktywności w tle
deferral.Complete();
}
}
}
Binary file added Assets/LargeTile.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/LargeTile.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/LargeTile.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/LargeTile.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/LargeTile.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/LockScreenLogo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SmallTile.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SmallTile.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SmallTile.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SmallTile.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SmallTile.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SplashScreen.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SplashScreen.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SplashScreen.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SplashScreen.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/SplashScreen.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Square150x150Logo.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Square150x150Logo.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Square150x150Logo.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Square150x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Square150x150Logo.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Square44x44Logo.scale-100.png
Binary file added Assets/Square44x44Logo.scale-125.png
Binary file added Assets/Square44x44Logo.scale-150.png
Binary file added Assets/Square44x44Logo.scale-200.png
Binary file added Assets/Square44x44Logo.scale-400.png
Binary file added Assets/Square44x44Logo.targetsize-16.png
Binary file added Assets/Square44x44Logo.targetsize-24.png
Binary file added Assets/Square44x44Logo.targetsize-256.png
Binary file added Assets/Square44x44Logo.targetsize-32.png
Binary file added Assets/Square44x44Logo.targetsize-48.png
Binary file added Assets/StoreLogo.backup.png
Binary file added Assets/StoreLogo.scale-100.png
Binary file added Assets/StoreLogo.scale-125.png
Binary file added Assets/StoreLogo.scale-150.png
Binary file added Assets/StoreLogo.scale-200.png
Binary file added Assets/StoreLogo.scale-400.png
Binary file added Assets/Wide310x150Logo.scale-100.png
Binary file added Assets/Wide310x150Logo.scale-125.png
Binary file added Assets/Wide310x150Logo.scale-150.png
Binary file added Assets/Wide310x150Logo.scale-200.png
Binary file added Assets/Wide310x150Logo.scale-400.png
43 changes: 43 additions & 0 deletions MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Page
x:Class="Translate.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Translate"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
muxc:BackdropMaterial.ApplyToRootOrPageBackground="True">

<Grid>
<Grid Height="48" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<Border x:Name="AppTitleBar"
IsHitTestVisible="True"
VerticalAlignment="Top"
Background="Transparent"
Height="40"
Canvas.ZIndex="1"
Margin="20,4,0,0">
<StackPanel Orientation="Horizontal">
<Image x:Name="AppFontIcon"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Source="Assets/Square44x44Logo.png"
Width="25"
Height="25"/>
<TextBlock x:Name="AppTitle"
Text="Translate"
VerticalAlignment="Center"
Margin="3,0,0,0"
Style="{StaticResource CaptionTextBlockStyle}" />
</StackPanel>
</Border>
<AppBarElementContainer HorizontalAlignment="Right" Margin="0,0,150,0" ToolTipService.ToolTip="Settings" Canvas.ZIndex="1"> <!--needs translation-->
<AppBarButton Icon="Setting" x:Name="SettingsButton" Click="SettingsButton_Click"></AppBarButton>
</AppBarElementContainer>
<Grid x:Name="TitleBar" Height="48" HorizontalAlignment="Stretch" Canvas.ZIndex="0" VerticalAlignment="Top"></Grid>
</Grid>

<Grid HorizontalAlignment="Stretch" Margin="0,48,0,0" VerticalAlignment="Stretch" Background="{StaticResource LayerFillColorDefaultBrush}"></Grid>
</Grid>
</Page>
36 changes: 36 additions & 0 deletions MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

//Szablon elementu Pusta strona jest udokumentowany na stronie https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x415

namespace Translate
{
/// <summary>
/// Pusta strona, która może być używana samodzielnie lub do której można nawigować wewnątrz ramki.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
Window.Current.SetTitleBar(TitleBar);
}

private void SettingsButton_Click(object sender, RoutedEventArgs e)
{

}
}
}
49 changes: 49 additions & 0 deletions Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">

<Identity
Name="5a1b20f4-1015-4560-92a1-450a033b17e1"
Publisher="CN=Bruno"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="5a1b20f4-1015-4560-92a1-450a033b17e1" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>Translate</DisplayName>
<PublisherDisplayName>Bruno</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="shfr.TranslateRewrite">
<uap:VisualElements
DisplayName="Translate"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="Translate"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
29 changes: 29 additions & 0 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Ogólne informacje o zestawie są kontrolowane poprzez następujący
// zestaw atrybutów. Zmień wartości tych atrybutów, aby zmodyfikować informacje
// powiązane z zestawem.
[assembly: AssemblyTitle("Translate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Translate")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Informacje o wersji zestawu zawierają następujące cztery wartości:
//
// Wersja główna
// Wersja pomocnicza
// Numer kompilacji
// Poprawka
//
// Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki
// przy użyciu symbolu „*”, tak jak pokazano poniżej:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
31 changes: 31 additions & 0 deletions Properties/Default.rd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
Ten plik zawiera dyrektywy środowiska uruchomieniowego używane przez środowisko .NET Native. Domyślne wartości w tym miejscu są odpowiednie dla większości
deweloperów. Możesz jednak zmodyfikować te parametry, aby zmodyfikować zachowanie optymalizatora .NET Native
.
Dyrektywy środowiska uruchomieniowego są udokumentowane pod adresem https://go.microsoft.com/fwlink/?LinkID=391919
Aby umożliwić pełne odbicie klasy App1.MyClass i jej wszystkich składowych publicznych/prywatnych, użyj opcji
<Type Name="App1.MyClass" Dynamic="Required All"/>
Aby włączyć dynamiczne tworzenie konkretnego wystąpienia klasy AppClass<T> w elemencie System.Int32, użyj opcji
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Użycie dyrektywy przestrzeni nazw w celu zastosowania zasad odbicia do wszystkich typów w danej przestrzeni nazw
<Namespace Name="DataClasses.ViewModels" Serialize="All" />
-->

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
Element zestawu z parametrem Name="*Application*" ma zastosowanie do wszystkich zestawów w
pakiecie aplikacji. Gwiazdki nie są symbolami wieloznacznymi.
-->
<Assembly Name="*Application*" Dynamic="Required All" />


<!-- Dodaj tutaj konkretne dyrektywy środowiska uruchomieniowego aplikacji. -->


</Application>
</Directives>
Loading

0 comments on commit 818d632

Please sign in to comment.