- aggiunti ProjectName e ProjectPath

This commit is contained in:
Emmanuele Sassi
2023-03-06 10:53:20 +01:00
parent 2a248795b1
commit db66fa17cd
4 changed files with 70 additions and 33 deletions
+4 -1
View File
@@ -5,7 +5,10 @@
xmlns:EgtWPFLib48="clr-namespace:EgtWPFLib48;assembly=EgtWPFLib48"
xmlns:PrintApp="clr-namespace:Icarus"
Style="{DynamicResource {x:Type EgtWPFLib48:EgtMainWindow}}"
Title="{Binding sTitle}" Icon="/Resources/Icarus.ico"
Title="{Binding sTitle}"
ProjectName="{Binding sProjectName}"
ProjectPath="{Binding sProjectPath}"
Icon="/Resources/Icarus.ico"
MinHeight="600" MinWidth="800"
AllowDrop="True" Drop="MainWindowV_Drop"
ShowInTaskbar="True"
+29 -10
View File
@@ -27,15 +27,31 @@ Public Class MainWindowVM
End Property
' Titolo
Private m_sTitle As String
Public Property sTitle As String
Public ReadOnly Property sTitle As String
Get
Return m_sTitle
Return "Icarus"
End Get
End Property
Public ReadOnly Property sProjectName As String
Get
Dim sFilePath As String = ""
EgtGetCurrFilePath(sFilePath)
If String.IsNullOrEmpty(sFilePath) Then
sFilePath = EgtMsg(MSG_TOPCOMMANDBAR + 1) & Map.refMainWindowVM.MainWindowM.nInstance.ToString()
Return sFilePath
Else
Return Path.GetFileNameWithoutExtension(sFilePath) & If(EgtGetModified(), "*", "")
End If
End Get
End Property
Public ReadOnly Property sProjectPath As String
Get
Dim sFilePath As String = ""
EgtGetCurrFilePath(sFilePath)
Return sFilePath
End Get
Set(value As String)
m_sTitle = value
NotifyPropertyChanged(NameOf(sTitle))
End Set
End Property
' proprietà che seleziona la giusta pagina del TabControl
@@ -82,10 +98,13 @@ Public Class MainWindowVM
'#Region "METHODS"
Friend Sub SetTitle(sTitle As String)
m_sTitle = sTitle
'm_sTitle = sTitle
'NotifyPropertyChanged(NameOf(sTitle))
'' aggiorno titolo nella secondaryPage che e' quello che si vede nella barra in alto
'Map.refSecondaryWindowVM.SetTitle(sTitle)
NotifyPropertyChanged(NameOf(sTitle))
' aggiorno titolo nella secondaryPage che e' quello che si vede nella barra in alto
Map.refSecondaryWindowVM.SetTitle(sTitle)
NotifyPropertyChanged(NameOf(sProjectName))
NotifyPropertyChanged(NameOf(sProjectPath))
End Sub
'Public Sub UpdateTitle()
+12 -12
View File
@@ -234,19 +234,19 @@ Public Class MySceneHostVM
End Sub
Friend Sub EmitTitle()
' nome file
Dim sTitle As String = MainController.GetCurrFile()
If String.IsNullOrEmpty(sTitle) Then
sTitle = EgtMsg(MSG_TOPCOMMANDBAR + 1) & Map.refMainWindowVM.MainWindowM.nInstance.ToString()
End If
' indicazione di modificato
If MainController.GetModified() Then
sTitle += "*"
End If
' dati del prodotto
sTitle += " - Icarus"
'' nome file
'Dim sTitle As String = MainController.GetCurrFile()
'If String.IsNullOrEmpty(sTitle) Then
' sTitle = EgtMsg(MSG_TOPCOMMANDBAR + 1) & Map.refMainWindowVM.MainWindowM.nInstance.ToString()
'End If
'' indicazione di modificato
'If MainController.GetModified() Then
' sTitle += "*"
'End If
'' dati del prodotto
'sTitle += " - Icarus"
' emissione del titolo
Map.refMainWindowVM.SetTitle(sTitle)
Map.refMainWindowVM.SetTitle("")
End Sub
#End Region ' METHODS
+25 -10
View File
@@ -123,6 +123,8 @@
<!--convertert per visibilita' stringa di testo con misure in StatusBar-->
<PrintApp:StringToVisibilityConverter x:Key="StringToVisibilityConverter"/>
<GridLength x:Key="TitleBarHeight">30</GridLength>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- FocusVisual standard-->
@@ -328,6 +330,11 @@
<Setter Property="Background" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style x:Key="TitleBar_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Background" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style x:Key="TopPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
@@ -4065,9 +4072,9 @@
<Grid Background="Transparent" x:Name="WindowRoot">
<Grid x:Name="LayoutRoot"
Background="{TemplateBinding Background}">
Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="{StaticResource TitleBarHeight}"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
@@ -4080,7 +4087,8 @@
</Grid.ColumnDefinitions>
<Button Command="{Binding AboutBoxCommand}"
Style="{StaticResource ProjManager_Button}">
Width="{Binding ActualHeight, ElementName=PART_HeaderBar}"
Style="{StaticResource TitleBar_Button}">
<Image Source="{TemplateBinding Icon}"/>
</Button>
<Grid Grid.Column="1">
@@ -4091,12 +4099,15 @@
</Grid.ColumnDefinitions>
<PrintApp:ProjManagerV DataContext="{StaticResource ProjManagerVM}"/>
<TextBlock Text="{TemplateBinding ProjectName}"
ToolTip="{TemplateBinding ProjectNamePath}"
ToolTip="{TemplateBinding ProjectPath}"
Grid.Column="1"
TextTrimming="CharacterEllipsis"
FontSize="14"
VerticalAlignment="Center"
Foreground="{StaticResource Icarus_Gray}"
Background="{StaticResource Icarus_Gray}"
Padding="5,2,5,3"
Margin="10,0,0,0"
Foreground="White"
IsEnabled="{TemplateBinding IsActive}"/>
<TextBlock Text="{TemplateBinding Title}"
Grid.Column="2"
@@ -4121,24 +4132,28 @@
</Grid.ColumnDefinitions>
<Button x:Name="MinimizeButton"
Style="{StaticResource ProjManager_Button}">
Width="{Binding ActualHeight, ElementName=PART_HeaderBar}"
Style="{StaticResource TitleBar_Button}">
<Image Source="\Resources\Common\Minimize.png"/>
</Button>
<Button x:Name="MaximizeButton"
Grid.Column="1"
Style="{StaticResource ProjManager_Button}">
Width="{Binding ActualHeight, ElementName=PART_HeaderBar}"
Style="{StaticResource TitleBar_Button}">
<Image Source="\Resources\Common\Maximize.png"/>
</Button>
<Button x:Name="RestoreButton"
Grid.Column="1"
Width="{Binding ActualHeight, ElementName=PART_HeaderBar}"
Visibility="Collapsed"
Style="{StaticResource ProjManager_Button}">
Style="{StaticResource TitleBar_Button}">
<Image Source="\Resources\Common\Restore.png"/>
</Button>
<Button x:Name="CloseButton"
Grid.Column="2"
Width="{Binding ActualHeight, ElementName=PART_HeaderBar}"
Command="{Binding CloseApplicationCommand, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ProjManager_Button}">
Style="{StaticResource TitleBar_Button}">
<Image Source="\Resources\Common\Close.png"/>
</Button>
</Grid>
@@ -4180,7 +4195,7 @@
<Grid x:Name="LayoutRoot"
Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition Height="36"/>
<RowDefinition Height="{StaticResource TitleBarHeight}"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>