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 ef336b0 commit 8a6f55c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ private async Task OnOtherAbout()
{
SPVCOA OtherAbout = new();

await OtherAbout.ShowAsync();
ContentDialogResult Result = await OtherAbout.ShowAsync();

if (Result == ContentDialogResult.Primary)
{
//TODO: eğer kullanıcı library sayfasında ise kütüphane yenilenmeli
}

OtherAbout.Dispose();
}
Expand Down
1 change: 1 addition & 0 deletions src/Portal/Sucrose.Portal/Views/Controls/ThemeCreate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
PrimaryButtonText="{DynamicResource Portal.ThemeCreate.Create}"
CloseButtonText="{DynamicResource Portal.ThemeCreate.Close}"
Title="{DynamicResource Portal.ThemeCreate.Title}"
PreviewKeyDown="ContentDialog_PreviewKeyDown"
IsPrimaryButtonEnabled="False"
Loaded="ContentDialog_Loaded"
DialogMaxWidth="750"
Expand Down
27 changes: 24 additions & 3 deletions src/Portal/Sucrose.Portal/Views/Controls/ThemeCreate.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using System.Windows.Input;
using Wpf.Ui.Controls;
using SPMI = Sucrose.Portal.Manage.Internal;

Expand Down Expand Up @@ -61,17 +62,37 @@ private void YouTubeCreate_Click(object sender, RoutedEventArgs e)
CreateCard.Visibility = Visibility.Collapsed;
}

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

private void ApplicationCreate_Click(object sender, RoutedEventArgs e)
{
IsPrimaryButtonEnabled = true;
ApplicationCard.Visibility = Visibility.Visible;
CreateCard.Visibility = Visibility.Collapsed;
}

private void ContentDialog_Loaded(object sender, RoutedEventArgs e)
private void ContentDialog_PreviewKeyDown(object sender, KeyEventArgs e)
{
//tema oluşturma türü seçildiyse aktif edilecek
//IsPrimaryButtonEnabled = true;
if ((e.Key == Key.Enter || e.Key == Key.Escape) && true)
{
e.Handled = true;
}
}

protected override void OnButtonClick(ContentDialogButton Button)
{
if (Button == ContentDialogButton.Primary)
{
//ilgili tema ekleme kontrolü burada yapılacak
//ThemeTitle.Focus();
//return;
}

base.OnButtonClick(Button);
}

public void Dispose()
Expand Down

0 comments on commit 8a6f55c

Please sign in to comment.