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
+70 -42
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,52 +25,76 @@
</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>
BorderBrush="LightGray" <DockPanel>
BorderThickness="1" <Border Height="25" Width="25" CornerRadius="5" Margin="2,0,0,0">
Header="Ambienti"> <Border.Background>
<StackPanel Name="LayoutRoot" <ImageBrush Stretch="Fill" ImageSource="/axlogo.ico"/>
VerticalAlignment="Center" </Border.Background>
Margin="5,5,5,5"> </Border>
<Button Style="{StaticResource TabButton}" <TextBlock Margin="5,0,0,0" FontWeight="DemiBold" Text="PAL Ax Utility" VerticalAlignment="Center"/>
x:Name="LIVE"
Click="ButtonClicked"
Height="115" Width="320"
Content="LIVE"
FontSize="36"/>
<DockPanel HorizontalAlignment="Center"
Margin="0,10,0,0">
<Button Style="{StaticResource TabButton}" <Button Style="{StaticResource TabButton}"
x:Name="DEV" Click="CloseButton"
Click="ButtonClicked" Height="25" Width="25"
Height="45" Width="100"
Margin="0,0,5,0"
Content="DEV"
FontSize="18" FontSize="18"
FontWeight="DemiBold" FontWeight="DemiBold"
Background="#00FF80"/> Background="Transparent"
<Button Style="{StaticResource TabButton}" HorizontalAlignment="Right"
x:Name="TEST" BorderBrush="{x:Null}"
Click="ButtonClicked" Margin="0,3,3,0">
Height="45" Width="100" <TextBlock Text="x" Margin="0,-5,0,0"/>
Margin="5,0,5,0" </Button>
Content="TEST"
FontSize="18"
FontWeight="DemiBold"
Background="#8080FF"/>
<Button Style="{StaticResource TabButton}"
x:Name="STAGING"
Click="ButtonClicked"
Height="45" Width="100"
Margin="5,0,0,0"
Content="STAGING"
FontSize="18"
FontWeight="DemiBold"
Background="#FFFF00"/>
</DockPanel> </DockPanel>
<GroupBox Margin="15,5,15,10"
VerticalAlignment="Center"
BorderBrush="LightGray"
BorderThickness="1"
Header="Ambienti">
<StackPanel Name="LayoutRoot"
VerticalAlignment="Center"
Margin="5,5,5,5">
<Button Style="{StaticResource TabButton}"
x:Name="LIVE"
Click="ButtonClicked"
Height="115" Width="320"
Content="LIVE"
FontSize="36"/>
<DockPanel HorizontalAlignment="Center"
Margin="0,10,0,0">
<Button Style="{StaticResource TabButton}"
x:Name="DEV"
Click="ButtonClicked"
Height="45" Width="100"
Margin="0,0,5,0"
Content="DEV"
FontSize="18"
FontWeight="DemiBold"
Background="#00FF80"/>
<Button Style="{StaticResource TabButton}"
x:Name="TEST"
Click="ButtonClicked"
Height="45" Width="100"
Margin="5,0,5,0"
Content="TEST"
FontSize="18"
FontWeight="DemiBold"
Background="#8080FF"/>
<Button Style="{StaticResource TabButton}"
x:Name="STAGING"
Click="ButtonClicked"
Height="45" Width="100"
Margin="5,0,0,0"
Content="STAGING"
FontSize="18"
FontWeight="DemiBold"
Background="#FFFF00"/>
</DockPanel>
</StackPanel>
</GroupBox>
</StackPanel> </StackPanel>
</GroupBox> </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>