Skip to content

Commit

Permalink
Preparing Theme Create Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Oct 21, 2023
1 parent 946b18f commit 76cff4e
Show file tree
Hide file tree
Showing 17 changed files with 289 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using SPEIL = Sucrose.Portal.Extension.ImageLoader;
using SPMI = Sucrose.Portal.Manage.Internal;
using SPMM = Sucrose.Portal.Manage.Manager;
using SPVCTC = Sucrose.Portal.Views.Controls.ThemeCreate;
using SPVCDP = Sucrose.Portal.Views.Controls.DisplayPreferences;
using SPVCOA = Sucrose.Portal.Views.Controls.OtherAbout;
using SPVCOH = Sucrose.Portal.Views.Controls.OtherHelp;
Expand Down Expand Up @@ -224,6 +225,16 @@ private async Task OnOtherAbout()
OtherAbout.Dispose();
}

[RelayCommand]
private async Task OnCreateWallpaper()
{
SPVCTC ThemeCreate = new();

await ThemeCreate.ShowAsync();

ThemeCreate.Dispose();
}

[RelayCommand]
private async Task OnDisplayPreferences()
{
Expand Down
151 changes: 151 additions & 0 deletions src/Portal/Sucrose.Portal/Views/Controls/ThemeCreate.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<ui:ContentDialog
x:Class="Sucrose.Portal.Views.Controls.ThemeCreate"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vcontrols="clr-namespace:Sucrose.Portal.Views.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Sucrose.Portal.Views.Controls"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
PrimaryButtonText="{DynamicResource Portal.ThemeCreate.Create}"
CloseButtonText="{DynamicResource Portal.ThemeCreate.Close}"
Title="{DynamicResource Portal.ThemeCreate.Title}"
IsPrimaryButtonEnabled="False"
Loaded="ContentDialog_Loaded"
DialogMaxWidth="750"
mc:Ignorable="d">

<ui:ContentDialog.Resources>
<Style BasedOn="{StaticResource {x:Type ui:ContentDialog}}" TargetType="{x:Type local:ThemeCreate}" />
</ui:ContentDialog.Resources>

<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Orientation="Vertical" MinWidth="400">
<StackPanel x:Name="CreateCard" HorizontalAlignment="Stretch" VerticalAlignment="Center" Orientation="Vertical">
<ui:Button
Margin="0"
Padding="0"
Cursor="Hand"
x:Name="GifCreate"
Appearance="Transparent"
BorderBrush="Transparent"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<vcontrols:ExpanderCard x:Name="GifExpander" TitleText="Gif Tema" DescriptionText="'Gif' türündeki kendi temanızı oluşturun." LeftIconSymbol="Gif24" IsEnabled="False" Expandable="False">
<vcontrols:ExpanderCard.HeaderFrame>
<ui:SymbolIcon
Width="32"
Symbol="ChevronRight24"
Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
</vcontrols:ExpanderCard.HeaderFrame>
</vcontrols:ExpanderCard>
</ui:Button>

<ui:Button
Padding="0"
Cursor="Hand"
Margin="0 3 0 0"
x:Name="UrlCreate"
Appearance="Transparent"
BorderBrush="Transparent"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<vcontrols:ExpanderCard x:Name="UrlExpander" TitleText="Url Tema" DescriptionText="'Url' türündeki kendi temanızı oluşturun." LeftIconSymbol="SlideLink24" IsEnabled="False" Expandable="False">
<vcontrols:ExpanderCard.HeaderFrame>
<ui:SymbolIcon
Width="32"
Symbol="ChevronRight24"
Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
</vcontrols:ExpanderCard.HeaderFrame>
</vcontrols:ExpanderCard>
</ui:Button>

<ui:Button
Padding="0"
Cursor="Hand"
Margin="0 3 0 0"
x:Name="WebCreate"
Appearance="Transparent"
BorderBrush="Transparent"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<vcontrols:ExpanderCard x:Name="WebExpander" TitleText="Web Tema" DescriptionText="'Web' türündeki kendi temanızı oluşturun." LeftIconSymbol="GlobeDesktop24" IsEnabled="False" Expandable="False">
<vcontrols:ExpanderCard.HeaderFrame>
<ui:SymbolIcon
Width="32"
Symbol="ChevronRight24"
Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
</vcontrols:ExpanderCard.HeaderFrame>
</vcontrols:ExpanderCard>
</ui:Button>

<ui:Button
Padding="0"
Cursor="Hand"
Margin="0 3 0 0"
x:Name="VideoCreate"
Appearance="Transparent"
BorderBrush="Transparent"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<vcontrols:ExpanderCard x:Name="VideoExpander" TitleText="Video Tema" DescriptionText="'Video' türündeki kendi temanızı oluşturun." LeftIconSymbol="VideoClip24" IsEnabled="False" Expandable="False">
<vcontrols:ExpanderCard.HeaderFrame>
<ui:SymbolIcon
Width="32"
Symbol="ChevronRight24"
Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
</vcontrols:ExpanderCard.HeaderFrame>
</vcontrols:ExpanderCard>
</ui:Button>

<ui:Button
Padding="0"
Cursor="Hand"
Margin="0 3 0 0"
x:Name="YouTubeCreate"
Appearance="Transparent"
BorderBrush="Transparent"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<vcontrols:ExpanderCard x:Name="YouTubeExpander" TitleText="YouTube Tema" DescriptionText="'YouTube' türündeki kendi temanızı oluşturun." LeftIconSymbol="VideoRecording20" IsEnabled="False" Expandable="False">
<vcontrols:ExpanderCard.HeaderFrame>
<ui:SymbolIcon
Width="32"
Symbol="ChevronRight24"
Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
</vcontrols:ExpanderCard.HeaderFrame>
</vcontrols:ExpanderCard>
</ui:Button>

<ui:Button
Padding="0"
Cursor="Hand"
Margin="0 3 0 0"
x:Name="ApplicationCreate"
Appearance="Transparent"
BorderBrush="Transparent"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<vcontrols:ExpanderCard x:Name="ApplicationExpander" TitleText="Application Tema" DescriptionText="'Application' türündeki kendi temanızı oluşturun." LeftIconSymbol="AppGeneric24" IsEnabled="False" Expandable="False">
<vcontrols:ExpanderCard.HeaderFrame>
<ui:SymbolIcon
Width="32"
Symbol="ChevronRight24"
Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
</vcontrols:ExpanderCard.HeaderFrame>
</vcontrols:ExpanderCard>
</ui:Button>
</StackPanel>
</StackPanel>
</ui:ContentDialog>
42 changes: 42 additions & 0 deletions src/Portal/Sucrose.Portal/Views/Controls/ThemeCreate.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System.IO;
using System.Windows;
using Wpf.Ui.Controls;
using SECNT = Skylark.Enum.ClearNumericType;
using SEMST = Skylark.Enum.ModeStorageType;
using SEST = Skylark.Enum.StorageType;
using SHC = Skylark.Helper.Culture;
using SHN = Skylark.Helper.Numeric;
using SMR = Sucrose.Memory.Readonly;
using SPEIL = Sucrose.Portal.Extension.ImageLoader;
using SPMI = Sucrose.Portal.Manage.Internal;
using SSESSE = Skylark.Standard.Extension.Storage.StorageExtension;
using SSSHS = Sucrose.Shared.Space.Helper.Size;
using SSSSS = Skylark.Struct.Storage.StorageStruct;
using SSTHI = Sucrose.Shared.Theme.Helper.Info;
using SSTHV = Sucrose.Shared.Theme.Helper.Various;

namespace Sucrose.Portal.Views.Controls
{
/// <summary>
/// ThemeCreate.xaml etkileşim mantığı
/// </summary>
public partial class ThemeCreate : ContentDialog, IDisposable
{
public ThemeCreate() : base(SPMI.ContentDialogService.GetContentPresenter())
{
InitializeComponent();
}

private void ContentDialog_Loaded(object sender, RoutedEventArgs e)
{
//tema oluşturma türü seçildiyse aktif edilecek
//IsPrimaryButtonEnabled = true;
}

public void Dispose()
{
GC.Collect();
GC.SuppressFinalize(this);
}
}
}
1 change: 1 addition & 0 deletions src/Portal/Sucrose.Portal/Views/Windows/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
Appearance="Transparent"
BorderBrush="Transparent"
Icon="{ui:SymbolIcon Add16}"
Command="{Binding ViewModel.CreateWallpaperCommand, Mode=OneWay}"
ToolTipService.ToolTip="{DynamicResource Portal.MainWindow.MenuCreateWallpaperTip}" />
<ui:Button
Cursor="Hand"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.DE.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.DE.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.DE.xaml" />
<ResourceDictionary Source="ThemeCreate/Portal.ThemeCreate.DE.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.DE.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.DE.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.EN.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.EN.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.EN.xaml" />
<ResourceDictionary Source="ThemeCreate/Portal.ThemeCreate.EN.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.EN.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.EN.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.ES.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.ES.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.ES.xaml" />
<ResourceDictionary Source="ThemeCreate/Portal.ThemeCreate.ES.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.ES.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.ES.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.FR.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.FR.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.FR.xaml" />
<ResourceDictionary Source="ThemeCreate/Portal.ThemeCreate.FR.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.FR.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.FR.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.PL.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.PL.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.PL.xaml" />
<ResourceDictionary Source="ThemeCreate/Portal.ThemeCreate.PL.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.PL.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.PL.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.TR.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.TR.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.TR.xaml" />
<ResourceDictionary Source="ThemeCreate/Portal.ThemeCreate.TR.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.TR.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.TR.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeCreate.Title">Tema Oluşturma</system:String>
<system:String x:Key="Portal.ThemeCreate.Create">Oluştur</system:String>
<system:String x:Key="Portal.ThemeCreate.Close">Kapat</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeCreate.Title">Tema Oluşturma</system:String>
<system:String x:Key="Portal.ThemeCreate.Create">Oluştur</system:String>
<system:String x:Key="Portal.ThemeCreate.Close">Kapat</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeCreate.Title">Tema Oluşturma</system:String>
<system:String x:Key="Portal.ThemeCreate.Create">Oluştur</system:String>
<system:String x:Key="Portal.ThemeCreate.Close">Kapat</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeCreate.Title">Tema Oluşturma</system:String>
<system:String x:Key="Portal.ThemeCreate.Create">Oluştur</system:String>
<system:String x:Key="Portal.ThemeCreate.Close">Kapat</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeCreate.Title">Tema Oluşturma</system:String>
<system:String x:Key="Portal.ThemeCreate.Create">Oluştur</system:String>
<system:String x:Key="Portal.ThemeCreate.Close">Kapat</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeCreate.Title">Tema Oluşturma</system:String>
<system:String x:Key="Portal.ThemeCreate.Create">Oluştur</system:String>
<system:String x:Key="Portal.ThemeCreate.Close">Kapat</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,30 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeCreate\Portal.ThemeCreate.PL.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeCreate\Portal.ThemeCreate.FR.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeCreate\Portal.ThemeCreate.ES.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeCreate\Portal.ThemeCreate.EN.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeCreate\Portal.ThemeCreate.DE.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeCreate\Portal.ThemeCreate.TR.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeDelete\Portal.ThemeDelete.DE.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down

0 comments on commit 76cff4e

Please sign in to comment.