aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Controls
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs10
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs24
2 files changed, 28 insertions, 6 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs
index 879401c1b..cefdbbfd6 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs
+++ b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs
@@ -252,7 +252,13 @@ namespace Tango.SharedUI.Controls
public static readonly DependencyProperty KeepElementsAttachedProperty =
DependencyProperty.Register("KeepElementsAttached", typeof(bool), typeof(NavigationControl), new PropertyMetadata(false));
-
+ public bool GalleryMode
+ {
+ get { return (bool)GetValue(GalleryModeProperty); }
+ set { SetValue(GalleryModeProperty, value); }
+ }
+ public static readonly DependencyProperty GalleryModeProperty =
+ DependencyProperty.Register("GalleryMode", typeof(bool), typeof(NavigationControl), new PropertyMetadata(false));
public int SelectedIndex
{
@@ -551,7 +557,7 @@ namespace Tango.SharedUI.Controls
break;
case TransitionTypes.Slide:
- if (toIndex > fromIndex)
+ if (toIndex > fromIndex || GalleryMode)
{
fromAnimation.From = 0;
fromAnimation.To = -ActualWidth;
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs
index 583d7b810..1f2856a32 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs
+++ b/Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs
@@ -12,6 +12,7 @@ using System.Windows.Input;
using System.Linq;
using System.Windows.Media;
using System.Windows.Threading;
+using Tango.Core.ExtensionMethods;
namespace Tango.SharedUI.Controls
{
@@ -73,6 +74,11 @@ namespace Tango.SharedUI.Controls
{
IsOpened = false;
SelectedItem = _listBox.SelectedItem;
+
+ if (SelectedValuePath.IsNotNullOrEmpty() && SelectedItem != null)
+ {
+ SelectedValue = SelectedItem.GetPropertyValueByPath(SelectedValuePath);
+ }
}
else if (e.Key == Key.Up && _listBox.SelectedIndex == 0)
{
@@ -120,6 +126,11 @@ namespace Tango.SharedUI.Controls
{
IsOpened = false;
SelectedItem = _listBox.SelectedItem;
+
+ if (SelectedValuePath.IsNotNullOrEmpty() && SelectedItem != null)
+ {
+ SelectedValue = SelectedItem.GetPropertyValueByPath(SelectedValuePath);
+ }
}
}
}
@@ -152,12 +163,17 @@ namespace Tango.SharedUI.Controls
if (x != null)
{
- var prop = x.GetType().GetProperty(SearchProperty, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
- if (prop != null)
+ if (!String.IsNullOrWhiteSpace(SearchProperty))
{
- String propValue = prop.GetValue(x).ToString();
- return propValue.ToLower().Contains(SearchFilter.ToLower());
+ var prop = x.GetType().GetProperty(SearchProperty, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
+ if (prop != null)
+ {
+ String propValue = prop.GetValue(x).ToString();
+ return propValue.ToLower().Contains(SearchFilter.ToLower());
+ }
}
+
+ return x.ToStringSafe().ToLower().Contains(SearchFilter.ToLower());
}
return false;