Skip to content

Commit

Permalink
Studio: Minor UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
NizamLZ committed Nov 6, 2017
1 parent adc7ff6 commit f19f522
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3605,19 +3605,19 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:ANA Conversation Studio"
"ProductCode" = "8:{190D00C8-8746-4F6D-96FF-02D0DDA75DFC}"
"PackageCode" = "8:{DA327D2B-255A-41D0-BEC7-A0DA4137CA38}"
"ProductCode" = "8:{F41F587C-3AEF-4C01-9499-56207C1C52EF}"
"PackageCode" = "8:{94880EB1-0670-4801-8FF7-9FE56821E667}"
"UpgradeCode" = "8:{1BD9D39A-BCB0-4988-88FE-7481A5494FFF}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:5.0.3"
"ProductVersion" = "8:5.0.4"
"Manufacturer" = "8:Project ANA"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:http://ana.chat"
"Title" = "8:ANA Conversation Studio 5.0.3"
"Title" = "8:ANA Conversation Studio 5.0.4"
"Subject" = "8:"
"ARPCONTACT" = "8:Project ANA"
"Keywords" = "8:"
Expand Down
1 change: 1 addition & 0 deletions ANAConversationStudio/ANAConversationStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
<Compile Include="UIHelpers\IsGoalNodeToBrushConverter.cs" />
<Compile Include="UIHelpers\ListToVisiblityConverter.cs" />
<Compile Include="UIHelpers\NodeTypeToGroupVisibilityConverter.cs" />
<Compile Include="UIHelpers\ConnectionToFillBrushConverter.cs" />
<Compile Include="UserControls\NodeEditorUserControl.xaml.cs">
<DependentUpon>NodeEditorUserControl.xaml</DependentUpon>
</Compile>
Expand Down
3 changes: 2 additions & 1 deletion ANAConversationStudio/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
<BooleanToVisibilityConverter x:Key="B2V"/>
<UI:FilePathToTitleConverter x:Key="FilePathToTitleConverter"/>
<UI:ListToVisiblityConverter x:Key="ListToVisiblityConverter"/>


<UI:ConnectionToFillBrushConverter x:Key="ConnectionToFillBrushConverter"/>
<UI:SelectionToFillBrushConverter x:Key="SelectionToFillBrushConverter"/>
<UI:IsStartNodeToBrushConverter x:Key="IsStartNodeToBrushConverter"/>
<UI:IsGoalNodeToBrushConverter x:Key="IsGoalNodeToBrushConverter"/>
Expand Down
4 changes: 2 additions & 2 deletions ANAConversationStudio/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.0.3.0")]
[assembly: AssemblyFileVersion("5.0.3.0")]
[assembly: AssemblyVersion("5.0.4.0")]
[assembly: AssemblyFileVersion("5.0.4.0")]
12 changes: 9 additions & 3 deletions ANAConversationStudio/Styles/SharedVisualTemplates.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
<Ellipse
Visibility="{Binding IsConnectionAttached, Converter={StaticResource booleanToVisibilityConverter}}"
Margin="3"
Fill="{StaticResource connectionBrush}"
Fill="{Binding ParentNode.IsSelected, Converter={StaticResource SelectionToFillBrushConverter}}"
IsHitTestVisible="False"
/>
</Grid>
Expand Down Expand Up @@ -216,9 +216,15 @@
<Ellipse
Visibility="{Binding IsConnectionAttached, Converter={StaticResource booleanToVisibilityConverter}}"
Margin="3"
Fill="{Binding ParentNode.IsSelected, Converter={StaticResource SelectionToFillBrushConverter}}"
IsHitTestVisible="False"
/>
>
<Ellipse.Fill>
<MultiBinding Converter="{StaticResource ConnectionToFillBrushConverter}">
<Binding Path="ParentNode.IsSelected" />
<Binding Path="AttachedConnections[0].DestConnector.ParentNode.IsSelected" />
</MultiBinding>
</Ellipse.Fill>
</Ellipse>
</Grid>
</Grid>
</DataTemplate>
Expand Down
35 changes: 35 additions & 0 deletions ANAConversationStudio/UIHelpers/ConnectionToFillBrushConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using ANAConversationStudio.ViewModels;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;

namespace ANAConversationStudio.UIHelpers
{
public class ConnectionToFillBrushConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
try
{
var srcConnectorParentNodeIsSelected = (bool)values[0];
var destConnectorParentNodeIsSelected = (bool)values[1];

return ((srcConnectorParentNodeIsSelected || destConnectorParentNodeIsSelected) ? Application.Current.Resources["connectionHighlightedBrush"] : Application.Current.Resources["connectionBrush"]);
}
catch (Exception ex)
{
return Application.Current.Resources["connectionBrush"];
}
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
18 changes: 15 additions & 3 deletions ANAConversationStudio/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,23 @@

<!-- The connection is represented by a curved arrow. -->
<Controls:CurvedArrow
Stroke="{Binding SourceConnector.ParentNode.IsSelected, Converter={StaticResource SelectionToFillBrushConverter}}"
StrokeThickness="2"
Fill="{Binding SourceConnector.ParentNode.IsSelected, Converter={StaticResource SelectionToFillBrushConverter}}"
Points="{Binding Points}"
/>
>
<Controls:CurvedArrow.Stroke>
<MultiBinding Converter="{StaticResource ConnectionToFillBrushConverter}">
<Binding Path="SourceConnector.ParentNode.IsSelected"/>
<Binding Path="DestConnector.ParentNode.IsSelected"/>
</MultiBinding>
</Controls:CurvedArrow.Stroke>
<Controls:CurvedArrow.Fill>
<MultiBinding Converter="{StaticResource ConnectionToFillBrushConverter}">
<Binding Path="SourceConnector.ParentNode.IsSelected"/>
<Binding Path="DestConnector.ParentNode.IsSelected"/>
</MultiBinding>
</Controls:CurvedArrow.Fill>
</Controls:CurvedArrow>


<ac:AdornedControl.AdornerContent>

Expand Down

0 comments on commit f19f522

Please sign in to comment.