Update front view and window management

This commit is contained in:
PAL\cbo
2022-03-08 17:05:43 +01:00
parent 501da46db8
commit 57cd4070cb
6 changed files with 91 additions and 49 deletions
+31 -3
View File
@@ -4,11 +4,15 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" mc:Ignorable="d"
MouseLeftButtonDown="MouseLeftDrag"
Height="260" Width="400" Height="260" Width="400"
ResizeMode="NoResize" ResizeMode="NoResize"
WindowStyle="None"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
AllowsTransparency="True"
Background="Transparent"
Title="PAL Ax Utility" Title="PAL Ax Utility"
Icon="/axlogo.png"> Icon="/axlogo.ico">
<Window.Resources> <Window.Resources>
<Style TargetType="Button" x:Key="TabButton"> <Style TargetType="Button" x:Key="TabButton">
@@ -21,9 +25,31 @@
</Style.Resources> </Style.Resources>
</Style> </Style>
</Window.Resources> </Window.Resources>
<Grid> <Grid>
<GroupBox Margin="15,10,15,10" <Border BorderBrush="#0082C4" BorderThickness="1.5" CornerRadius="10" Background="White">
VerticalAlignment="Top" <StackPanel>
<DockPanel>
<Border Height="25" Width="25" CornerRadius="5" Margin="2,0,0,0">
<Border.Background>
<ImageBrush Stretch="Fill" ImageSource="/axlogo.ico"/>
</Border.Background>
</Border>
<TextBlock Margin="5,0,0,0" FontWeight="DemiBold" Text="PAL Ax Utility" VerticalAlignment="Center"/>
<Button Style="{StaticResource TabButton}"
Click="CloseButton"
Height="25" Width="25"
FontSize="18"
FontWeight="DemiBold"
Background="Transparent"
HorizontalAlignment="Right"
BorderBrush="{x:Null}"
Margin="0,3,3,0">
<TextBlock Text="x" Margin="0,-5,0,0"/>
</Button>
</DockPanel>
<GroupBox Margin="15,5,15,10"
VerticalAlignment="Center"
BorderBrush="LightGray" BorderBrush="LightGray"
BorderThickness="1" BorderThickness="1"
Header="Ambienti"> Header="Ambienti">
@@ -68,5 +94,7 @@
</DockPanel> </DockPanel>
</StackPanel> </StackPanel>
</GroupBox> </GroupBox>
</StackPanel>
</Border>
</Grid> </Grid>
</Window> </Window>
+17 -6
View File
@@ -2,6 +2,7 @@
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input;
namespace wpf_ax_utility namespace wpf_ax_utility
{ {
@@ -12,30 +13,40 @@ namespace wpf_ax_utility
InitializeComponent(); InitializeComponent();
} }
private void MouseLeftDrag(object sender, MouseButtonEventArgs e)
{
DragMove();
}
private void CloseButton(object sender, RoutedEventArgs e)
{
Close();
}
private void ButtonClicked(object sender, RoutedEventArgs e) private void ButtonClicked(object sender, RoutedEventArgs e)
{ {
AucCleaner(); AucCleaner();
string AxClient = @"C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe"; string AxClient = @"C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe";
string AxArguments = string.Empty; string AxArgs = string.Empty;
switch (((Button)sender).Name) switch (((Button)sender).Name)
{ {
case "LIVE": case "LIVE":
AxArguments = @"-regConfig=L:\Link\PAL_LIVE_02_USR.axc"; AxArgs = @"-regConfig=L:\Link\PAL_LIVE_02_USR.axc";
break; break;
case "DEV": case "DEV":
AxArguments = @"-regConfig=L:\Link\PAL_DEVELOP_USR.axc"; AxArgs = @"-regConfig=L:\Link\PAL_DEVELOP_USR.axc";
break ; break ;
case "TEST": case "TEST":
AxArguments = @"-regConfig=L:\Link\PAL_TEST_USR.axc"; AxArgs = @"-regConfig=L:\Link\PAL_TEST_USR.axc";
break; break;
case "STAGING": case "STAGING":
AxArguments = @"-regConfig=L:\Link\PAL_STAGING_USR.axc"; AxArgs = @"-regConfig=L:\Link\PAL_STAGING_USR.axc";
break; ; break; ;
} }
AxExecution(AxClient, AxArguments); AxExecution(AxClient, AxArgs);
} }
public static void AxExecution(string AxClient, string AxArgs) public static void AxExecution(string AxClient, string AxArgs)
Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

+4 -1
View File
@@ -8,12 +8,15 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<None Remove="axlogo.ico" />
<None Remove="axlogo.png" /> <None Remove="axlogo.png" />
<None Remove="rdrect1197.png" /> <None Remove="rdrect1197.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="axlogo.png" /> <Resource Include="axlogo.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup> </ItemGroup>
</Project> </Project>