Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
BlameTwo committed Apr 1, 2023
1 parent 55b50ad commit e81cd7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChatGPT_GUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Height="600"
d:DataContext="{d:DesignInstance Type=viewmodels:MainViewModel}"
MaxButtonVisibility="Collapsed"
ShowInTaskbar="True"
Style="{DynamicResource DefaultWindowBaseStyle}"
mc:Ignorable="d">

Expand Down
13 changes: 11 additions & 2 deletions ChatGPT_GUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using ChatGPT_GUI.ViewModels;
using SimpleUI.Controls;
using System;
using System.Windows.Automation.Peers;
using System.Windows.Interop;

namespace ChatGPT_GUI {
/// <summary>
Expand All @@ -11,15 +13,22 @@ public MainWindow(MainViewModel vm) {
InitializeComponent();
this.Loaded += MainWindow_Loaded;
this.DataContext = vm;
this.WindowBackdrop = new SimpleUI.Utils.Backdrop.AcrylicBackdrop();
}
private const int GWL_STYLE = -16;
private const int WS_SYSMENU = 0x80000;

private void MainWindow_Loaded(object sender, System.Windows.RoutedEventArgs e) {
if(this.DataContext is MainViewModel vm) {

IntPtr hwnd = new WindowInteropHelper(this).Handle;
//SimpleUI.Win32.Win32.SetWindowLong(hwnd, (-20), 0x80);
//SimpleUI.Win32.Win32.SetWindowLong(hwnd, GWL_STYLE, SimpleUI.Win32.Win32.GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU);
if (this.DataContext is MainViewModel vm) {
vm.ToastLitterMessage.ShowOwner = this.grid;
vm.ToastLitterMessage.ShowTime = TimeSpan.FromSeconds(5);
vm.AppNavigationViewService.Init(this.Framebase, true);
}
}


}
}

0 comments on commit e81cd7f

Please sign in to comment.